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:
Philipp Hörist 2017-12-29 20:14:59 +01:00
parent 361ad92b26
commit b8fd8c8a3f
1 changed files with 1 additions and 1 deletions

View File

@ -477,7 +477,7 @@ class ConnectionVcard:
def _get_vcard_photo(self, vcard, jid):
try:
photo = vcard['PHOTO']['BINVAL']
except (KeyError, AttributeError):
except (KeyError, AttributeError, TypeError):
avatar_sha = None
photo_decoded = None
else: