ignore unparsable vcards. fixes #2826
This commit is contained in:
parent
775b85a83e
commit
476908a54b
|
@ -886,7 +886,12 @@ class ConnectionVcard:
|
||||||
f = open(path_to_file)
|
f = open(path_to_file)
|
||||||
c = f.read()
|
c = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
|
try:
|
||||||
card = common.xmpp.Node(node = c)
|
card = common.xmpp.Node(node = c)
|
||||||
|
except:
|
||||||
|
# We are unable to parse it. Remove it
|
||||||
|
os.remove(path_to_file)
|
||||||
|
return None
|
||||||
vcard = self.node_to_dict(card)
|
vcard = self.node_to_dict(card)
|
||||||
if vcard.has_key('PHOTO'):
|
if vcard.has_key('PHOTO'):
|
||||||
if not isinstance(vcard['PHOTO'], dict):
|
if not isinstance(vcard['PHOTO'], dict):
|
||||||
|
|
Loading…
Reference in New Issue