Check if we have a nbxmpp Client object

In some cases the XMPPDispatcher which handles the callbacks is not
yet created.
This commit is contained in:
Philipp Hörist 2018-07-07 20:01:47 +02:00
parent e918ac85fe
commit 3a6f667008
1 changed files with 2 additions and 0 deletions

View File

@ -1446,5 +1446,7 @@ ConnectionHandlersBase, ConnectionJingle, ConnectionIBBytestream):
con.RegisterHandler(*handler)
def _unregister_handlers(self):
if not self.connection:
return
for handler in modules.get_handlers(self):
self.connection.UnregisterHandler(*handler)