diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-06-23 14:34:24 +0200 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-06-23 14:34:24 +0200 |
commit | 66909aafb300868ffd3ed9ab02bc3bd28c49a6e9 (patch) | |
tree | f84c74d494d7230da8123d6c54f7e7fa61da36b8 | |
parent | cdfb5d56fc42a117c629c2b81505a159d93eaa25 (diff) | |
download | slixmpp-66909aafb300868ffd3ed9ab02bc3bd28c49a6e9.tar.gz slixmpp-66909aafb300868ffd3ed9ab02bc3bd28c49a6e9.tar.bz2 slixmpp-66909aafb300868ffd3ed9ab02bc3bd28c49a6e9.tar.xz slixmpp-66909aafb300868ffd3ed9ab02bc3bd28c49a6e9.zip |
XEP-0153: Prevent a panic when the BINVAL is invalid.
-rw-r--r-- | slixmpp/plugins/xep_0153/vcard_avatar.py | 6 |
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: |