From 9f613afd4f2ed2ff9885b59f0087690c8f7ad739 Mon Sep 17 00:00:00 2001 From: Jean-Marie Traissard Date: Sun, 1 Jun 2008 21:13:06 +0000 Subject: [PATCH] Don't traceback when refiltering during the model.clear (has a bad account name). Fixes #3893. --- src/common/contacts.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/common/contacts.py b/src/common/contacts.py index 63724c238..3882c5009 100644 --- a/src/common/contacts.py +++ b/src/common/contacts.py @@ -246,9 +246,10 @@ class Contacts: return None def iter_contacts(self, account): - for jid in self._contacts[account]: - for contact in self._contacts[account][jid]: - yield contact + if account in self._contacts: + for jid in self._contacts[account]: + for contact in self._contacts[account][jid]: + yield contact def get_contact_from_full_jid(self, account, fjid): ''' Get Contact object for specific resource of given jid'''