From 5deb3696f5fcd210d16d21f85822970f9d0c92ab Mon Sep 17 00:00:00 2001 From: Psychokiller1888 Date: Wed, 6 Sep 2023 12:28:46 +0200 Subject: [PATCH] Should fix timer errors --- core/util/ThreadManager.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/util/ThreadManager.py b/core/util/ThreadManager.py index 0a96aa42a..9334136c3 100644 --- a/core/util/ThreadManager.py +++ b/core/util/ThreadManager.py @@ -107,15 +107,15 @@ def doLater(self, interval: float, func: Callable, args: list = None, kwargs: di def onTimerEnd(self, timer: ThreadTimer): - if not timer or not timer.callback: - return - - timer.callback(*timer.args, **timer.kwargs) - self.removeTimer(timer) - + try: + timer.callback(*timer.args, **timer.kwargs) + self.removeTimer(timer) + except: + # timer has no callback + pass def removeTimer(self, timer: ThreadTimer): - if not timer or not timer.callback: + if not timer: return if timer.timer.is_alive():