changeset 327:7c9784658163

core: fixed crash when roster list is empty
author Goffi <goffi@goffi.org>
date Sun, 22 May 2011 12:59:25 +0200
parents 0f9925193586
children 809733b8d9be
files src/tools/memory.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/tools/memory.py	Tue May 17 01:34:17 2011 +0200
+++ b/src/tools/memory.py	Sun May 22 12:59:25 2011 +0200
@@ -624,9 +624,10 @@
             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@'):