XEP-0153: Prevent a panic when the BINVAL is invalid.
This commit is contained in:
parent
cdfb5d56fc
commit
66909aafb3
@ -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
|
||||||
|
try:
|
||||||
data = iq['vcard_temp']['PHOTO']['BINVAL']
|
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:
|
if not data:
|
||||||
new_hash = ''
|
new_hash = ''
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user