Prevent crashes if contact is null
This commit is contained in:
parent
fb88c5df48
commit
e931733ebf
2 changed files with 9 additions and 6 deletions
|
@ -60,7 +60,7 @@ class GroupInfoAdapter extends RecyclerView.Adapter<GroupInfoViewHolder> {
|
|||
LinphoneContact c = ca.getContact();
|
||||
|
||||
holder.name.setText(
|
||||
(c.getFullName() != null)
|
||||
(c != null && c.getFullName() != null)
|
||||
? c.getFullName()
|
||||
: (ca.getDisplayName() != null) ? ca.getDisplayName() : ca.getUsername());
|
||||
|
||||
|
|
|
@ -78,11 +78,14 @@ public class ContactAddress implements Serializable {
|
|||
}
|
||||
|
||||
public Address getAddress() {
|
||||
String presence =
|
||||
mContact.getContactFromPresenceModelForUriOrTel(
|
||||
(mPhoneNumber != null && !mPhoneNumber.isEmpty())
|
||||
? mPhoneNumber
|
||||
: mAddress);
|
||||
String presence = null;
|
||||
if (mContact != null) {
|
||||
presence =
|
||||
mContact.getContactFromPresenceModelForUriOrTel(
|
||||
(mPhoneNumber != null && !mPhoneNumber.isEmpty())
|
||||
? mPhoneNumber
|
||||
: mAddress);
|
||||
}
|
||||
Address addr = Factory.instance().createAddress(presence != null ? presence : mAddress);
|
||||
// Remove the user=phone URI param if existing, it will break everything otherwise
|
||||
if (addr.hasUriParam("user")) {
|
||||
|
|
Loading…
Reference in a new issue