From 8d1179952aefaa0086ff5540671cfd6ff612594b Mon Sep 17 00:00:00 2001 From: Trevor Norris Date: Thu, 5 Feb 2015 16:52:09 -0700 Subject: [PATCH] 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. --- src/async-wrap-inl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/async-wrap-inl.h b/src/async-wrap-inl.h index 6b434c08c00..f0b5c1ea08f 100644 --- a/src/async-wrap-inl.h +++ b/src/async-wrap-inl.h @@ -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,