diff src/tools/memory.py @ 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 ca3a041fed30
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@'):