Mercurial > libervia-backend
comparison 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 |
comparison
equal
deleted
inserted
replaced
326:0f9925193586 | 327:7c9784658163 |
---|---|
622 profile = self.getProfileName(profile_key) | 622 profile = self.getProfileName(profile_key) |
623 if not profile: | 623 if not profile: |
624 error(_('Asking contacts for a non-existant profile')) | 624 error(_('Asking contacts for a non-existant profile')) |
625 return [] | 625 return [] |
626 ret=[] | 626 ret=[] |
627 for contact in self.contacts[profile]: | 627 if self.contacts.has_key(profile): |
628 attr, groups = self.contacts[profile][contact] | 628 for contact in self.contacts[profile]: |
629 ret.append([contact, attr, groups ]) | 629 attr, groups = self.contacts[profile][contact] |
630 ret.append([contact, attr, groups ]) | |
630 return ret | 631 return ret |
631 | 632 |
632 def addPresenceStatus(self, contact_jid, show, priority, statuses, profile_key='@DEFAULT@'): | 633 def addPresenceStatus(self, contact_jid, show, priority, statuses, profile_key='@DEFAULT@'): |
633 profile = self.getProfileName(profile_key) | 634 profile = self.getProfileName(profile_key) |
634 if not profile: | 635 if not profile: |