catch traceback when decoding avatar. Fixes #1470
This commit is contained in:
parent
f62db4acfe
commit
327f07c6aa
1 changed files with 5 additions and 2 deletions
|
@ -282,8 +282,11 @@ class Connection:
|
||||||
if vcard.has_key('PHOTO') and isinstance(vcard['PHOTO'], dict) and \
|
if vcard.has_key('PHOTO') and isinstance(vcard['PHOTO'], dict) and \
|
||||||
vcard['PHOTO'].has_key('BINVAL'):
|
vcard['PHOTO'].has_key('BINVAL'):
|
||||||
photo = vcard['PHOTO']['BINVAL']
|
photo = vcard['PHOTO']['BINVAL']
|
||||||
|
try:
|
||||||
photo_decoded = base64.decodestring(photo)
|
photo_decoded = base64.decodestring(photo)
|
||||||
avatar_sha = sha.sha(photo_decoded).hexdigest()
|
avatar_sha = sha.sha(photo_decoded).hexdigest()
|
||||||
|
except:
|
||||||
|
avatar_sha = ''
|
||||||
else:
|
else:
|
||||||
avatar_sha = ''
|
avatar_sha = ''
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue