From 4ee3566a749e504c5168ca3b4eb2fdc57ab92b07 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Thu, 26 Apr 2012 01:57:46 +0200 Subject: Avoid a traceback when getting the nick of a converstation with someone not in our roster. fixes #2356 --- src/tabs.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') 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: -- cgit v1.2.3