From df04516e855b996bcecd5a0a9147a4c5bbf4bea8 Mon Sep 17 00:00:00 2001 From: "Romain DEP." Date: Sat, 4 Nov 2017 21:56:59 +0400 Subject: [PATCH 1/2] [client_icons] fix exception with pidgin --- clients_icons/clients_icons.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/clients_icons/clients_icons.py b/clients_icons/clients_icons.py index e420ec7..7779b34 100644 --- a/clients_icons/clients_icons.py +++ b/clients_icons/clients_icons.py @@ -533,10 +533,11 @@ class ClientsIconsPlugin(GajimPlugin): tag = iq_obj.stanza.getTags('c') if tag: caps = tag[0].getAttr('node') - if 'pidgin.im/' in caps: - caps = 'libpurple' - if 'sleekxmpp.com' in caps: - caps = 'httр://sleekxmpp.com/ver/1.1.11' + if caps: + if 'pidgin.im/' in caps: + caps = 'libpurple' + if 'sleekxmpp.com' in caps: + caps = 'httр://sleekxmpp.com/ver/1.1.11' iter_ = iq_obj.gc_control.get_contact_iter(iq_obj.nick) model = iq_obj.gc_control.model if model[iter_][self.muc_renderer_num] is not None: From 8e2ad109f6e4f6e70353541f7b84a74a5e7f6ec7 Mon Sep 17 00:00:00 2001 From: "Romain DEP." Date: Sat, 4 Nov 2017 22:14:07 +0400 Subject: [PATCH 2/2] [preview] catch type error when clen is None --- url_image_preview/http_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/url_image_preview/http_functions.py b/url_image_preview/http_functions.py index bd708b4..19fbf42 100644 --- a/url_image_preview/http_functions.py +++ b/url_image_preview/http_functions.py @@ -67,7 +67,7 @@ def _get_http_head_direct(url): clen = f.headers['Content-Length'] try: clen = int(clen) - except ValueError: + except (TypeError, ValueError): pass return (ctype, clen)