From 281c7f3a82068420ac65b9e05744855a2f355670 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Fri, 30 Sep 2011 10:11:08 +0200 Subject: [PATCH] print warning instead of traceback when we get a commands request from an invalid JID. Fixes #6995 --- src/common/commands.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/common/commands.py b/src/common/commands.py index d303de922..2e831d9cb 100644 --- a/src/common/commands.py +++ b/src/common/commands.py @@ -27,6 +27,9 @@ import helpers import dataforms import gajim +import logging +log = logging.getLogger('gajim.c.commands') + class AdHocCommand: commandnode = 'command' commandname = 'The Command' @@ -371,7 +374,11 @@ class ConnectionCommands: Send disco#info result for query for command (JEP-0050, example 6.). Return True if the result was sent, False if not """ - jid = helpers.get_full_jid_from_iq(iq_obj) + try: + jid = helpers.get_full_jid_from_iq(iq_obj) + except helpers.InvalidFormat: + log.warn('Invalid JID: %s, ignoring it' % iq_obj.getFrom()) + return node = iq_obj.getTagAttr('query', 'node') if node not in self.__commands: return False