summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--slixmpp/plugins/xep_0153/vcard_avatar.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/slixmpp/plugins/xep_0153/vcard_avatar.py b/slixmpp/plugins/xep_0153/vcard_avatar.py
index f1591e27..bbbbd2ad 100644
--- a/slixmpp/plugins/xep_0153/vcard_avatar.py
+++ b/slixmpp/plugins/xep_0153/vcard_avatar.py
@@ -138,7 +138,11 @@ class XEP_0153(BasePlugin):
if iq['type'] == 'error':
log.debug('Could not retrieve vCard for %s', jid)
return
- data = iq['vcard_temp']['PHOTO']['BINVAL']
+ try:
+ data = iq['vcard_temp']['PHOTO']['BINVAL']
+ except ValueError:
+ log.debug('Invalid BINVAL in vCard’s PHOTO for %s:', jid, exc_info=True)
+ data = None
if not data:
new_hash = ''
else: