From a6be55a3cfae27406eb9599e3de3788086f5c23c Mon Sep 17 00:00:00 2001 From: Pshy0 Date: Mon, 21 Aug 2023 17:41:58 +0200 Subject: [PATCH] fixed possible crash possibly caused by ghost timer --- lua/pshy/bases/loopmore.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/pshy/bases/loopmore.lua b/lua/pshy/bases/loopmore.lua index 3483b58c..f02f0673 100644 --- a/lua/pshy/bases/loopmore.lua +++ b/lua/pshy/bases/loopmore.lua @@ -4,6 +4,7 @@ -- -- @author TFM:Pshy#3752 DC:Pshy#7998 pshy.require("pshy.events") +pshy.require("pshy.utils.print") @@ -51,7 +52,10 @@ end local function TimerCallback(tfmid, id) local timer = timers[id] --print("timer #" .. tostring(id) .. "/" .. tostring(#timers) .. ": " .. tostring(os.time() % 10000)) - assert(timer ~= nil, "timer #" .. tostring(id) .. "/" .. tostring(#timers) .. ": " .. tostring(os.time() % 10000)) + if timer == nil then + print_error("timer was nil: #" .. tostring(id) .. "/" .. tostring(#timers) .. ": " .. tostring(os.time() % 10000)) + return + end --timer.sync_time = os.time() % tfm_timers_interval RunLoopMore() end