diff options
author | cjihrig <cjihrig@gmail.com> | 2018-11-03 17:41:10 +0300 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2018-11-07 20:29:22 +0300 |
commit | 312baacd934d53079e4e04fdcd9647660692f97e (patch) | |
tree | d6ef97c2a756af1da64d2fa3efa8a1a3762a8a31 /src/async_wrap.cc | |
parent | c3809ffc243c04b0de3dc3ef289bb713bbd832a9 (diff) |
src: fix Get() usage in async_wrap.cc
PR-URL: https://github.com/nodejs/node/pull/24060
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'src/async_wrap.cc')
-rw-r--r-- | src/async_wrap.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/async_wrap.cc b/src/async_wrap.cc index 471fa231c2e..52601ffc8f0 100644 --- a/src/async_wrap.cc +++ b/src/async_wrap.cc @@ -347,8 +347,13 @@ void AsyncWrap::WeakCallback(const v8::WeakCallbackInfo<DestroyParam>& info) { std::unique_ptr<DestroyParam> p{info.GetParameter()}; Local<Object> prop_bag = PersistentToLocal(info.GetIsolate(), p->propBag); + Local<Value> val; + + if (!prop_bag->Get(p->env->context(), p->env->destroyed_string()) + .ToLocal(&val)) { + return; + } - Local<Value> val = prop_bag->Get(p->env->destroyed_string()); if (val->IsFalse()) { AsyncWrap::EmitDestroy(p->env, p->asyncId); } |