Skip to content

Commit 1476182

Browse files
himself65MylesBorins
authored andcommitted
src: handle NULL env scenario
PR-URL: #32230 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me>
1 parent 71a2fa2 commit 1476182

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/module_wrap.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,8 @@ void ModuleWrap::SetImportModuleDynamicallyCallback(
572572
void ModuleWrap::HostInitializeImportMetaObjectCallback(
573573
Local<Context> context, Local<Module> module, Local<Object> meta) {
574574
Environment* env = Environment::GetCurrent(context);
575-
CHECK_NOT_NULL(env); // TODO(addaleax): Handle nullptr here.
575+
if (env == nullptr)
576+
return;
576577
ModuleWrap* module_wrap = GetFromModule(env, module);
577578

578579
if (module_wrap == nullptr) {

0 commit comments

Comments
 (0)