diff --git a/src/chat.py b/src/chat.py index f35cd83e7..f64b92501 100644 --- a/src/chat.py +++ b/src/chat.py @@ -686,13 +686,15 @@ class Chat: childs[5].connect('activate', self.on_start_chat_activate, text) childs[6].connect('activate', self.on_join_group_chat_menuitem_activate, text) - u = self.plugin.roster.contacts[self.account][text][0] - if self.plugin.roster.contacts[self.account].has_key(text) and \ - 'not in the roster' not in u.groups: - childs[7].hide() - else: - childs[7].connect('activate', self.on_add_to_roster_activate, text) - childs[7].show() + if self.plugin.roster.contacts[self.account].has_key(text): + u = self.plugin.roster.contacts[self.account][text][0] + + if self.plugin.roster.contacts[self.account].has_key(text) and \ + 'not in the roster' not in u.groups: + childs[7].hide() # add to roster menuitem + else: + childs[7].connect('activate', self.on_add_to_roster_activate, text) + childs[7].show() childs[0].hide() # copy link location childs[1].hide() # open link in browser