From 07d552b6562a8ddb15f2dd90ced4027c1f719b77 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 19 May 2009 14:12:38 +0200 Subject: [PATCH] prevent traceback when trying to print error message in a non existing message window. Fixes #5036 --- src/gajim.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gajim.py b/src/gajim.py index b486c2d2c..98a8dda77 100644 --- a/src/gajim.py +++ b/src/gajim.py @@ -953,6 +953,10 @@ class Interface: #('MSGNOTSENT', account, (jid, ierror_msg, msg, time, session)) msg = _('error while sending %(message)s ( %(error)s )') % { 'message': array[2], 'error': array[1]} + if not array[4]: + # No session. This can happen when sending a message from gajim-remote + log.warn(msg) + return array[4].roster_message(array[0], msg, array[3], account, msg_type='error')