Skip to content

Commit

Permalink
asyncwrap: fix nullptr parent check
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
trevnorris committed Feb 5, 2015
1 parent 62512bb commit 8d11799
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/async-wrap-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ inline AsyncWrap::AsyncWrap(Environment* env,
// Check user controlled flag to see if the init callback should run.
if (!env->using_asyncwrap())
return;
if (!env->call_async_init_hook() && parent != nullptr)
if (!env->call_async_init_hook() && parent == nullptr)
return;

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

0 comments on commit 8d11799

Please sign in to comment.