Skip to content

Commit

Permalink
src: handle NULL env scenario
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
himself65 authored and MylesBorins committed Mar 24, 2020
1 parent 71a2fa2 commit 1476182
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/module_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,8 @@ void ModuleWrap::SetImportModuleDynamicallyCallback(
void ModuleWrap::HostInitializeImportMetaObjectCallback(
Local<Context> context, Local<Module> module, Local<Object> meta) {
Environment* env = Environment::GetCurrent(context);
CHECK_NOT_NULL(env); // TODO(addaleax): Handle nullptr here.
if (env == nullptr)
return;
ModuleWrap* module_wrap = GetFromModule(env, module);

if (module_wrap == nullptr) {
Expand Down

0 comments on commit 1476182

Please sign in to comment.