# HG changeset patch # User Goffi # Date 1306061965 -7200 # Node ID 7c9784658163f33f0ea79d1d16cbcd30005a2c6a # Parent 0f99251935869a7c3ce6e01bd1e172b1315ce2a8 core: fixed crash when roster list is empty diff -r 0f9925193586 -r 7c9784658163 src/tools/memory.py --- 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@'):