From 327f07c6aab5c9552d47c604c9862aa0c71fd4a0 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Fri, 3 Feb 2006 12:32:18 +0000 Subject: [PATCH] catch traceback when decoding avatar. Fixes #1470 --- src/common/connection.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index b58464725..5d9623031 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -282,8 +282,11 @@ class Connection: if vcard.has_key('PHOTO') and isinstance(vcard['PHOTO'], dict) and \ vcard['PHOTO'].has_key('BINVAL'): photo = vcard['PHOTO']['BINVAL'] - photo_decoded = base64.decodestring(photo) - avatar_sha = sha.sha(photo_decoded).hexdigest() + try: + photo_decoded = base64.decodestring(photo) + avatar_sha = sha.sha(photo_decoded).hexdigest() + except: + avatar_sha = '' else: avatar_sha = ''