check if connection is active before sending something.

This commit is contained in:
Yann Leboulanger 2007-01-11 19:58:51 +00:00
parent 99f8a9cbb9
commit 2f857047d3
1 changed files with 2 additions and 2 deletions

View File

@ -487,7 +487,7 @@ class CommandWindow:
def send_cancel(self):
'''Send the command with action='cancel'. '''
assert self.commandnode is not None
if self.sessionid is not None:
if self.sessionid is not None and self.account.connection:
# we already have sessionid, so the service sent at least one reply.
stanza = xmpp.Iq(typ='set', to=self.jid)
stanza.addChild('command', attrs={