fixed npe when binval value of vcard avatar is null

This commit is contained in:
Daniel Gultsch 2015-05-07 11:07:15 +02:00
parent d74e8a8a0e
commit 05f0aa614f
1 changed files with 3 additions and 2 deletions

View File

@ -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);