From 0eb077bf4216cac6c9fa58b70577fd960f094f46 Mon Sep 17 00:00:00 2001 From: tjmv Date: Wed, 8 Nov 2023 11:24:14 +0100 Subject: [PATCH] Fix a race condition in bulb.py when closing while a bulb is offline --- pywizlight/bulb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pywizlight/bulb.py b/pywizlight/bulb.py index f1f2f4c..a97a88e 100755 --- a/pywizlight/bulb.py +++ b/pywizlight/bulb.py @@ -376,7 +376,7 @@ async def _send_udp_message_with_retry( send_wait = FIRST_SEND_INTERVAL total_waited = 0.0 for send in range(MAX_SEND_DATAGRAMS): - if transport.is_closing() or response_future.done(): + if transport is None or transport.is_closing() or response_future.done(): return attempt = send + 1 _LOGGER.debug(