diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-05-07 11:07:15 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-05-07 11:07:15 +0200 |
commit | 05f0aa614f5af638c6d6da5a4c6a119e1ec6eda8 (patch) | |
tree | 92ec2d05857435ef1fc5ea05548114cf77386573 | |
parent | d74e8a8a0ea20258e9e0eefbea75f94b7559f9b7 (diff) |
fixed npe when binval value of vcard avatar is null
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/XmppConnectionService.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index 6b53b758..e58f760e 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -1988,8 +1988,9 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa Element vCard = packet.findChild("vCard","vcard-temp"); Element photo = vCard != null ? vCard.findChild("PHOTO") : null; Element binval = photo != null ? photo.findChild("BINVAL") : null; - if (binval != null) { - avatar.image = binval.getContent(); + String image = binval != null ? binval.getContent() : null; + if (image != null) { + avatar.image = image; if (getFileBackend().save(avatar)) { Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": successfully fetched vCard avatar for " + avatar.owner); |