From a0c7155140f50b2b1c22e7c1347be1024d4e3af8 Mon Sep 17 00:00:00 2001 From: mathieui Date: Mon, 31 Mar 2014 22:19:42 +0200 Subject: Fix a traceback with broken roster items only happens with buggy servers (hello ejabberd) --- src/core.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/core.py b/src/core.py index bf24a20e..1cdf9e6c 100644 --- a/src/core.py +++ b/src/core.py @@ -3378,11 +3378,16 @@ class Core(object): The roster was received. """ for item in iq['roster']: - jid = item['jid'] - if item['subscription'] == 'remove': - del roster[jid] + try: + jid = item['jid'] + except InvalidJID: + jid = item._get_attr('jid', '') + log.error('Invalid JID: "%s"', jid, exc_info=True) else: - roster.update_contact_groups(jid) + if item['subscription'] == 'remove': + del roster[jid] + else: + roster.update_contact_groups(jid) if isinstance(self.current_tab(), tabs.RosterInfoTab): self.refresh_window() -- cgit v1.2.3