summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2012-04-26 01:57:46 +0200
committerFlorent Le Coz <louiz@louiz.org>2012-04-26 01:57:46 +0200
commit4ee3566a749e504c5168ca3b4eb2fdc57ab92b07 (patch)
treee785627fc47c08cc4aba2a1353f80c4728cb120f
parent2f78a5f2dd3cf73a15700f236cf69384c930f7eb (diff)
downloadpoezio-4ee3566a749e504c5168ca3b4eb2fdc57ab92b07.tar.gz
poezio-4ee3566a749e504c5168ca3b4eb2fdc57ab92b07.tar.bz2
poezio-4ee3566a749e504c5168ca3b4eb2fdc57ab92b07.tar.xz
poezio-4ee3566a749e504c5168ca3b4eb2fdc57ab92b07.zip
Avoid a traceback when getting the nick of a converstation with someone not in our roster. fixes #2356
-rw-r--r--src/tabs.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tabs.py b/src/tabs.py
index 82427715..f8923304 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -2500,7 +2500,11 @@ class ConversationTab(ChatTab):
def get_nick(self):
jid = JID(self.name)
- return roster.get_contact_by_jid(jid.bare).name or jid.user
+ contact = roster.get_contact_by_jid(jid.bare)
+ if contact:
+ return contact.name
+ else:
+ return jid.user
def on_input(self, key, raw):
if not raw and key in self.key_func: