XEP-0153: Prevent a panic when the BINVAL is invalid.

This commit is contained in:
Emmanuel Gil Peyrot 2018-06-23 14:34:24 +02:00
parent cdfb5d56fc
commit 66909aafb3

View File

@ -138,7 +138,11 @@ class XEP_0153(BasePlugin):
if iq['type'] == 'error': if iq['type'] == 'error':
log.debug('Could not retrieve vCard for %s', jid) log.debug('Could not retrieve vCard for %s', jid)
return return
data = iq['vcard_temp']['PHOTO']['BINVAL'] try:
data = iq['vcard_temp']['PHOTO']['BINVAL']
except ValueError:
log.debug('Invalid BINVAL in vCards PHOTO for %s:', jid, exc_info=True)
data = None
if not data: if not data:
new_hash = '' new_hash = ''
else: else: