XEP-0153: Prevent a panic when the BINVAL is invalid.
This commit is contained in:
parent
cdfb5d56fc
commit
66909aafb3
1 changed files with 5 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue