Fix NPE
This commit is contained in:
parent
3860136d94
commit
7fb02ae0ba
1 changed files with 7 additions and 1 deletions
|
@ -1103,6 +1103,9 @@ public class LinphoneActivity extends FragmentActivity implements
|
||||||
public void run() {
|
public void run() {
|
||||||
for (int i = 0; i < sipContactCursor.getCount(); i++) {
|
for (int i = 0; i < sipContactCursor.getCount(); i++) {
|
||||||
Contact contact = Compatibility.getContact(getContentResolver(), sipContactCursor, i);
|
Contact contact = Compatibility.getContact(getContentResolver(), sipContactCursor, i);
|
||||||
|
if (contact == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
contact.refresh(getContentResolver());
|
contact.refresh(getContentResolver());
|
||||||
if (!isContactPresenceDisabled) {
|
if (!isContactPresenceDisabled) {
|
||||||
searchFriendAndAddToContact(contact);
|
searchFriendAndAddToContact(contact);
|
||||||
|
@ -1111,8 +1114,11 @@ public class LinphoneActivity extends FragmentActivity implements
|
||||||
}
|
}
|
||||||
for (int i = 0; i < contactCursor.getCount(); i++) {
|
for (int i = 0; i < contactCursor.getCount(); i++) {
|
||||||
Contact contact = Compatibility.getContact(getContentResolver(), contactCursor, i);
|
Contact contact = Compatibility.getContact(getContentResolver(), contactCursor, i);
|
||||||
|
if (contact == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
for (Contact c : sipContactList) {
|
for (Contact c : sipContactList) {
|
||||||
if (c.getID().equals(contact.getID())) {
|
if (c != null && c.getID().equals(contact.getID())) {
|
||||||
contact = c;
|
contact = c;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue