Philipp Hörist pushed to branch master at gajim / gajim

Commits:
b8fd8c8a by Philipp Hörist at 2017-12-29T20:14:59+01:00
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

- - - - -


1 changed file:

- gajim/common/connection_handlers.py


Changes:

=====================================
gajim/common/connection_handlers.py
=====================================
--- a/gajim/common/connection_handlers.py
+++ b/gajim/common/connection_handlers.py
@@ -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:



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/b8fd8c8a3fbdd1f69528ce6e9de3d75c11a98f6f

---
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/b8fd8c8a3fbdd1f69528ce6e9de3d75c11a98f6f
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to