core: don't callback self.conn_deferred if already called:
if the connection has been lost (e.g. forced disconnection by server), `self.conn_deferred` may have already been called, thus this is now checked to avoid an exception.
This commit is contained in:
parent
3838f04169
commit
7c37f32dc4
1 changed files with 5 additions and 1 deletions
|
|
@ -302,7 +302,11 @@ class SatXMPPEntity:
|
|||
self.streamInitialized()
|
||||
|
||||
def _finish_connection(self, __):
|
||||
self.conn_deferred.callback(None)
|
||||
if self.conn_deferred.called:
|
||||
# can happen in case of forced disconnection by server
|
||||
log.debug(f"{self} has already been connected")
|
||||
else:
|
||||
self.conn_deferred.callback(None)
|
||||
|
||||
def streamInitialized(self):
|
||||
"""Called after _authd"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue