From 0ab2d6996e049ee7b7322191a05a11f20e64b795 Mon Sep 17 00:00:00 2001 From: Maximilian Giller Date: Tue, 30 Jan 2024 20:13:11 +0100 Subject: [PATCH] More None checks --- src/handler/action_queue.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/handler/action_queue.py b/src/handler/action_queue.py index 4be20e1..702cc01 100644 --- a/src/handler/action_queue.py +++ b/src/handler/action_queue.py @@ -17,7 +17,7 @@ class ActionQueue: async def run_queue(self): while True: try: - if self.queued_actions.empty() and self.idle_action[0] is not None: + if self.queued_actions.empty() and self.idle_action is not None and self.idle_action[0] is not None: self.idle_action_task = asyncio.create_task(self.idle_action[0](*(self.idle_action[1]), **(self.idle_action[2]))) action = await self.queued_actions.get() @@ -26,7 +26,7 @@ class ActionQueue: self.idle_action_task.cancel() self.idle_action_task = None - if action is not None: # If none -> Is idle action update + if action is not None and action[0] is not None: # If none -> Is idle update try: await action[0](*(action[1]), **(action[2])) except Exception as ex: