prevent traceback when a room is destroyed. Fixes #5194

This commit is contained in:
Yann Leboulanger 2009-08-01 18:28:25 +02:00
parent 2ffd6cbcb8
commit f501c2c4fe
1 changed files with 7 additions and 6 deletions

View File

@ -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()