Skip to content

Commit

Permalink
check if _disconnect_waiter is None when closing connection
Browse files Browse the repository at this point in the history
  • Loading branch information
HerrMuellerluedenscheid authored and FlorianLudwig committed Nov 29, 2022
1 parent 09ac98d commit 19960e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion amqtt/mqtt/protocol/client_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ async def handle_pingresp(self, pingresp: PingRespPacket):

async def handle_connection_closed(self):
self.logger.debug("Broker closed connection")
if not self._disconnect_waiter.done():
if self._disconnect_waiter is not None and not self._disconnect_waiter.done():
self._disconnect_waiter.set_result(None)

async def wait_disconnect(self):
Expand Down

0 comments on commit 19960e6

Please sign in to comment.