diff options
author | mathieui <mathieui@mathieui.net> | 2012-08-31 22:41:36 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2012-08-31 22:41:36 +0200 |
commit | 84887d17af1e445652074b5611df92799069f173 (patch) | |
tree | be01199a88131b2d5932d6feaeadeb360155cdf0 /src/roster.py | |
parent | 2c95177fbeb606dd5f77c226b02fb28ade60d24a (diff) | |
download | poezio-84887d17af1e445652074b5611df92799069f173.tar.gz poezio-84887d17af1e445652074b5611df92799069f173.tar.bz2 poezio-84887d17af1e445652074b5611df92799069f173.tar.xz poezio-84887d17af1e445652074b5611df92799069f173.zip |
Fix a traceback when a group has no name and a crash when dns gets interrupted
- http://pastebin.archlinux.fr/449676
Diffstat (limited to 'src/roster.py')
-rw-r--r-- | src/roster.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/roster.py b/src/roster.py index 3458d5b5..0c91b3fe 100644 --- a/src/roster.py +++ b/src/roster.py @@ -95,7 +95,15 @@ class Roster(object): def get_groups(self, sort=''): """Return a list of the RosterGroups""" - group_list = sorted(filter(lambda x: bool(x), self.groups.values()), key=lambda x: x.name.lower()) + group_list = sorted( + filter( + lambda x: bool(x), + self.groups.values() + ), + key=lambda x: x.name.lower() if x.name else '' + ) + + log.debug("Current groups: %s", group_list) for sorting in sort.split(':'): if sorting == 'reverse': |