From ad19f954ac1036922ac4932bf9755bed2bd07e29 Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Fri, 10 Jun 2005 13:46:41 +0000
Subject: [PATCH] fix #421

---
 src/tabbed_chat_window.py | 2 ++
 src/vcard.py              | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/tabbed_chat_window.py b/src/tabbed_chat_window.py
index 36c59d66cc..0c7b82d093 100644
--- a/src/tabbed_chat_window.py
+++ b/src/tabbed_chat_window.py
@@ -122,6 +122,8 @@ class Tabbed_chat_window(chat.Chat):
 	def set_avatar(self, vcard):
 		if not vcard.has_key('PHOTO'):
 			return
+		if type(vcard['PHOTO']) != type({}):
+			return
 		img_decoded = None
 		if vcard['PHOTO'].has_key('BINVAL'):
 			try:
diff --git a/src/vcard.py b/src/vcard.py
index 75790c2fea..25fcd919e1 100644
--- a/src/vcard.py
+++ b/src/vcard.py
@@ -135,10 +135,10 @@ class Vcard_window:
 			pass
 
 	def set_values(self, vcard):
-		if not type(vcard[i]) == type({}):
-			return
 		for i in vcard.keys():
 			if i == 'PHOTO':
+				if not type(vcard[i]) == type({}):
+					continue
 				img_decoded = None
 				if vcard[i].has_key('BINVAL') and vcard[i].has_key('TYPE'):
 					img_encoded = vcard[i]['BINVAL']
-- 
GitLab