Catch exception when parsing avatars
If the VCard contains a <PHOTO/> tag this is parsed as {'PHOTO': ''} this throws: TypeError: string indices must be integers
This commit is contained in:
parent
361ad92b26
commit
b8fd8c8a3f
|
@ -477,7 +477,7 @@ class ConnectionVcard:
|
||||||
def _get_vcard_photo(self, vcard, jid):
|
def _get_vcard_photo(self, vcard, jid):
|
||||||
try:
|
try:
|
||||||
photo = vcard['PHOTO']['BINVAL']
|
photo = vcard['PHOTO']['BINVAL']
|
||||||
except (KeyError, AttributeError):
|
except (KeyError, AttributeError, TypeError):
|
||||||
avatar_sha = None
|
avatar_sha = None
|
||||||
photo_decoded = None
|
photo_decoded = None
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue