From f501c2c4feedcde1b7ba0e79170b4ce57731fe85 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sat, 1 Aug 2009 18:28:25 +0200 Subject: [PATCH] prevent traceback when a room is destroyed. Fixes #5194 --- src/common/connection_handlers.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py index af4894a9d..4b93ffd01 100644 --- a/src/common/connection_handlers.py +++ b/src/common/connection_handlers.py @@ -2329,12 +2329,13 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco, r = destroy.getTagData('reason') if r: reason += ' (%s)' % r - try: - jid = helpers.parse_jid(destroy.getAttr('jid')) - except common.helpers.InvalidFormat: - pass - if jid: - reason += '\n' + _('You can join this room instead: %s') % jid + if destroy.getAttr('jid'): + try: + jid = helpers.parse_jid(destroy.getAttr('jid')) + reason += '\n' + _('You can join this room instead: %s') \ + % jid + except common.helpers.InvalidFormat: + pass statusCode = ['destroyed'] else: reason = prs.getReason()