changeset 2156:e2aa8372c4bf

Warn if a command with empty user jid has been received.
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Mon, 18 Jun 2007 03:19:28 +0200
parents 4138e1f06617
children c3bf2fa18b9a
files jabberbot/xmppbot.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/jabberbot/xmppbot.py	Mon Jun 18 03:17:50 2007 +0200
+++ b/jabberbot/xmppbot.py	Mon Jun 18 03:19:28 2007 +0200
@@ -175,6 +175,10 @@
         """
         # Handle normal notifications
         if isinstance(command, cmd.NotificationCommand):
+            if not command.jid:
+                self.log("Received a command with empty jid, looks like a bug!")
+                return
+            
             jid = JID(node_or_jid=command.jid)
             jid_text = jid.bare().as_utf8()
             text = command.text