From b8fd8c8a3fbdd1f69528ce6e9de3d75c11a98f6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Fri, 29 Dec 2017 20:14:59 +0100 Subject: [PATCH] Catch exception when parsing avatars If the VCard contains a tag this is parsed as {'PHOTO': ''} this throws: TypeError: string indices must be integers --- gajim/common/connection_handlers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gajim/common/connection_handlers.py b/gajim/common/connection_handlers.py index 018045b77..7a40be15d 100644 --- 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: