Skip to content

Commit 46c751e

Browse files
himself65targos
authored andcommittedApr 22, 2020
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 0e92244 commit 46c751e

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
@@ -1492,7 +1492,8 @@ void ModuleWrap::SetImportModuleDynamicallyCallback(
14921492
void ModuleWrap::HostInitializeImportMetaObjectCallback(
14931493
Local<Context> context, Local<Module> module, Local<Object> meta) {
14941494
Environment* env = Environment::GetCurrent(context);
1495-
CHECK_NOT_NULL(env); // TODO(addaleax): Handle nullptr here.
1495+
if (env == nullptr)
1496+
return;
14961497
ModuleWrap* module_wrap = GetFromModule(env, module);
14971498

14981499
if (module_wrap == nullptr) {

0 commit comments

Comments
 (0)
Please sign in to comment.