Skip to content

Commit 8d11799

Browse files
committed
asyncwrap: fix nullptr parent check
The nullptr check for parent on entry to the constructor should be == not !=. This allows reqs that have a parent to run their own init hook callbacks even if kCallInitHook has been disabled.
1 parent 62512bb commit 8d11799

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/async-wrap-inl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ inline AsyncWrap::AsyncWrap(Environment* env,
2323
// Check user controlled flag to see if the init callback should run.
2424
if (!env->using_asyncwrap())
2525
return;
26-
if (!env->call_async_init_hook() && parent != nullptr)
26+
if (!env->call_async_init_hook() && parent == nullptr)
2727
return;
2828

2929
// TODO(trevnorris): Until it's verified all passed object's are not weak,

0 commit comments

Comments
 (0)