Skip to content

Commit a254fea

Browse files
committed
fix: assert fail when no errors in callback due to wong if condition
1 parent c867835 commit a254fea

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lua/sync.lua

+5-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@ local function async(func)
4343
error("unhandled error " .. thunk)
4444
end
4545

46-
if co.status(thread) == "dead" and parent_handler_callback then
47-
parent_handler_callback(thunk)
46+
assert(ok, thunk)
47+
if co.status(thread) == "dead" then
48+
if parent_handler_callback then
49+
parent_handler_callback(thunk)
50+
end
4851
else
4952
assert(type(thunk) == "function", "type error :: expected func")
5053
thunk(step)

0 commit comments

Comments
 (0)