prevent traceback when we get a presence from an invalid JID

This commit is contained in:
Yann Leboulanger 2009-04-29 17:34:27 +00:00
parent 533e36c22c
commit 1a8def3341
1 changed files with 1 additions and 1 deletions

View File

@ -2075,7 +2075,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
try: try:
who = helpers.get_full_jid_from_iq(prs) who = helpers.get_full_jid_from_iq(prs)
except Exception: except Exception:
if prs.getTag('error').getTag('jid-malformed'): if prs.getTag('error') and prs.getTag('error').getTag('jid-malformed'):
# wrong jid, we probably tried to change our nick in a room to a non # wrong jid, we probably tried to change our nick in a room to a non
# valid one # valid one
who = str(prs.getFrom()) who = str(prs.getFrom())