prevent traceback when trying to print error message in a non existing message window. Fixes #5036

This commit is contained in:
Yann Leboulanger 2009-05-19 14:12:38 +02:00
parent 7d725fc1ab
commit 07d552b656

View file

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