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 targos committed Apr 22, 2020
1 parent 0e92244 commit 46c751e
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 @@ -1492,7 +1492,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 46c751e

Please sign in to comment.