Fix crash in search chat view when a contact didn't have a name
This commit is contained in:
parent
5a746abfac
commit
caff7b87d7
2 changed files with 3 additions and 1 deletions
|
@ -947,7 +947,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
for (ContactAddress c : searchAdapter.contacts) {
|
||||
String address = c.address;
|
||||
if (address.startsWith("sip:")) address = address.substring(4);
|
||||
if (c.contact.getFullName().toLowerCase(Locale.getDefault()).startsWith(search.toLowerCase(Locale.getDefault()))
|
||||
if (c.contact.getFullName() != null && c.contact.getFullName().toLowerCase(Locale.getDefault()).startsWith(search.toLowerCase(Locale.getDefault()))
|
||||
|| address.toLowerCase(Locale.getDefault()).startsWith(search.toLowerCase(Locale.getDefault()))) {
|
||||
result.add(c);
|
||||
}
|
||||
|
|
|
@ -717,6 +717,8 @@ public class LinphonePreferences {
|
|||
}
|
||||
|
||||
public int getDefaultAccountIndex() {
|
||||
if (getLc() == null)
|
||||
return -1;
|
||||
LinphoneProxyConfig defaultPrxCfg = getLc().getDefaultProxyConfig();
|
||||
if (defaultPrxCfg == null)
|
||||
return -1;
|
||||
|
|
Loading…
Reference in a new issue