Skip to content

Commit

Permalink
src: fix Get() usage in async_wrap.cc
Browse files Browse the repository at this point in the history
PR-URL: #24060
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
  • Loading branch information
cjihrig authored and BridgeAR committed Nov 13, 2018
1 parent 6fdc5d9 commit 9437aaa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/async_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,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);
}
Expand Down

0 comments on commit 9437aaa

Please sign in to comment.