Do not add in linphonecore friends with invalid sip address + fix crash in contacts list
This commit is contained in:
parent
43090dd342
commit
8e8a86941d
2 changed files with 7 additions and 1 deletions
|
@ -551,11 +551,17 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
|
|||
|
||||
@Override
|
||||
public int getPositionForSection(int sectionIndex) {
|
||||
if (sectionIndex >= sections.length || sectionIndex < 0) {
|
||||
return 0;
|
||||
}
|
||||
return map.get(sections[sectionIndex]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSectionForPosition(int position) {
|
||||
if (position >= contacts.size() || position < 0) {
|
||||
return 0;
|
||||
}
|
||||
LinphoneContact contact = contacts.get(position);
|
||||
String letter = contact.getFullName().substring(0, 1);
|
||||
return sectionsList.indexOf(letter);
|
||||
|
|
|
@ -409,7 +409,7 @@ public class LinphoneContact implements Serializable {
|
|||
}
|
||||
}
|
||||
LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
||||
if (lc != null) {
|
||||
if (lc != null && friend.getAddress() != null) {
|
||||
try {
|
||||
lc.addFriend(friend);
|
||||
} catch (LinphoneCoreException e) {
|
||||
|
|
Loading…
Reference in a new issue