core: fixed crash when roster list is empty

This commit is contained in:
Goffi 2011-05-22 12:59:25 +02:00
commit 80327010ed

View file

@ -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@'):