fix crash when a contact has been removed

This commit is contained in:
Romain Bignon 2014-12-20 16:23:17 +01:00
commit 917cd06677

View file

@ -97,6 +97,11 @@ class TinderModule(Module, CapMessages, CapMessagesPost, CapDating):
def iter_threads(self):
for thread in self.browser.get_threads():
if not 'person' in thread:
# The account has been removed, probably because it was a
# spammer.
continue
t = Thread(thread['_id'])
t.flags = Thread.IS_DISCUSSION
t.title = u'Discussion with %s' % thread['person']['name']