Skip to content

Commit 995aa0f

Browse files
committed
src: Handle NULL env scenario
1 parent e458747 commit 995aa0f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/module_wrap.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1529,7 +1529,8 @@ void ModuleWrap::SetImportModuleDynamicallyCallback(
15291529
void ModuleWrap::HostInitializeImportMetaObjectCallback(
15301530
Local<Context> context, Local<Module> module, Local<Object> meta) {
15311531
Environment* env = Environment::GetCurrent(context);
1532-
CHECK_NOT_NULL(env); // TODO(addaleax): Handle nullptr here.
1532+
if (env == nullptr)
1533+
return;
15331534
ModuleWrap* module_wrap = GetFromModule(env, module);
15341535

15351536
if (module_wrap == nullptr) {

0 commit comments

Comments
 (0)