From 925ea453f354c69d92ea8b6a6a35f5729ba26503 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Mon, 3 Feb 2014 21:33:00 +0100 Subject: Do not crash on /names with invalid affiliations --- src/tabs.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/tabs.py b/src/tabs.py index 12a3cd62..dd58a3a1 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -1122,14 +1122,15 @@ class MucTab(ChatTab): users = self.users[:] users.sort(key=lambda x: x.nick.lower()) for user in users: + color = aff.get(user.affiliation, get_theme().CHAR_AFFILIATION_NONE) if user.role == 'visitor': - visitors.append((user, aff[user.affiliation])) + visitors.append((user, color)) elif user.role == 'participant': - participants.append((user, aff[user.affiliation])) + participants.append((user, color)) elif user.role == 'moderator': - moderators.append((user, aff[user.affiliation])) + moderators.append((user, color)) else: - others.append((user, aff[user.affiliation])) + others.append((user, color)) buff = ['Users: %s \n' % len(self.users)] for moderator in moderators: -- cgit v1.2.3