Skip to content

Commit 8f8c380

Browse files
cjihrigkiyomizumia
authored andcommitted
src: fix Get() usage in async_wrap.cc
PR-URL: nodejs#24060 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
1 parent f1822e3 commit 8f8c380

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/async_wrap.cc

+6-1
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,13 @@ void AsyncWrap::WeakCallback(const v8::WeakCallbackInfo<DestroyParam>& info) {
347347

348348
std::unique_ptr<DestroyParam> p{info.GetParameter()};
349349
Local<Object> prop_bag = PersistentToLocal(info.GetIsolate(), p->propBag);
350+
Local<Value> val;
351+
352+
if (!prop_bag->Get(p->env->context(), p->env->destroyed_string())
353+
.ToLocal(&val)) {
354+
return;
355+
}
350356

351-
Local<Value> val = prop_bag->Get(p->env->destroyed_string());
352357
if (val->IsFalse()) {
353358
AsyncWrap::EmitDestroy(p->env, p->asyncId);
354359
}

0 commit comments

Comments
 (0)