prevent traceback when going offline while a jingle session is active

This commit is contained in:
Yann Leboulanger 2011-10-12 21:07:02 +02:00
parent 8305f6d68e
commit 27a85b128e
1 changed files with 4 additions and 3 deletions

View File

@ -672,6 +672,7 @@ class JingleSession(object):
def __content_remove(self, content, reason=None): def __content_remove(self, content, reason=None):
assert self.state != JingleStates.ended assert self.state != JingleStates.ended
if self.connection.connection and self.connection.connected > 1:
stanza, jingle = self.__make_jingle('content-remove', reason=reason) stanza, jingle = self.__make_jingle('content-remove', reason=reason)
self.__append_content(jingle, content) self.__append_content(jingle, content)
self.connection.connection.send(stanza) self.connection.connection.send(stanza)