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();
|
LinphoneContact c = ca.getContact();
|
||||||
|
|
||||||
holder.name.setText(
|
holder.name.setText(
|
||||||
(c.getFullName() != null)
|
(c != null && c.getFullName() != null)
|
||||||
? c.getFullName()
|
? c.getFullName()
|
||||||
: (ca.getDisplayName() != null) ? ca.getDisplayName() : ca.getUsername());
|
: (ca.getDisplayName() != null) ? ca.getDisplayName() : ca.getUsername());
|
||||||
|
|
||||||
|
|
|
@ -78,11 +78,14 @@ public class ContactAddress implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Address getAddress() {
|
public Address getAddress() {
|
||||||
String presence =
|
String presence = null;
|
||||||
mContact.getContactFromPresenceModelForUriOrTel(
|
if (mContact != null) {
|
||||||
(mPhoneNumber != null && !mPhoneNumber.isEmpty())
|
presence =
|
||||||
? mPhoneNumber
|
mContact.getContactFromPresenceModelForUriOrTel(
|
||||||
: mAddress);
|
(mPhoneNumber != null && !mPhoneNumber.isEmpty())
|
||||||
|
? mPhoneNumber
|
||||||
|
: mAddress);
|
||||||
|
}
|
||||||
Address addr = Factory.instance().createAddress(presence != null ? presence : mAddress);
|
Address addr = Factory.instance().createAddress(presence != null ? presence : mAddress);
|
||||||
// Remove the user=phone URI param if existing, it will break everything otherwise
|
// Remove the user=phone URI param if existing, it will break everything otherwise
|
||||||
if (addr.hasUriParam("user")) {
|
if (addr.hasUriParam("user")) {
|
||||||
|
|
Loading…
Reference in a new issue