From 80327010ed13a09f9eeb143c0d7dce013325aa53 Mon Sep 17 00:00:00 2001 From: Goffi Date: Sun, 22 May 2011 12:59:25 +0200 Subject: [PATCH] core: fixed crash when roster list is empty --- src/tools/memory.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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@'):