diff --git a/lib/init.lua b/lib/init.lua index b5d71db..07781a7 100644 --- a/lib/init.lua +++ b/lib/init.lua @@ -715,7 +715,9 @@ do if connection == nil then -- first is nil when connection is nil first = node connection = Promise._timeEvent:Connect(function() - while first.endTime <= Promise._getTime() do + local threadStart = Promise._getTime() + + while first ~= nil and first.endTime < threadStart do local current = first first = current.next @@ -727,7 +729,6 @@ do end current.resolve(Promise._getTime() - current.startTime) - if current.next == nil then return end -- kill this thread if there was no `first` before `resolve` end end) else -- first is non-nil