diff --git a/src/tools/memory.py b/src/tools/memory.py index 02905393..9cb274f8 100644 --- a/src/tools/memory.py +++ b/src/tools/memory.py @@ -624,9 +624,10 @@ class Memory: error(_('Asking contacts for a non-existant profile')) return [] ret=[] - for contact in self.contacts[profile]: - attr, groups = self.contacts[profile][contact] - ret.append([contact, attr, groups ]) + if self.contacts.has_key(profile): + for contact in self.contacts[profile]: + attr, groups = self.contacts[profile][contact] + ret.append([contact, attr, groups ]) return ret def addPresenceStatus(self, contact_jid, show, priority, statuses, profile_key='@DEFAULT@'):