Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhimself65 <himself65@outlook.com>2020-03-12 18:48:01 +0300
committerMatheus Marchini <mmarchini@netflix.com>2020-03-18 01:16:30 +0300
commit960df3fd90bcbf14d9fae44929a4c9e6a29a694d (patch)
tree8a4072cf4c0ddabc9cc7092b36a5cc049da61263 /src/module_wrap.cc
parentc788964a75c7ccec63bce9d464e9c96eb6e17080 (diff)
src: handle NULL env scenario
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'src/module_wrap.cc')
-rw-r--r--src/module_wrap.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/module_wrap.cc b/src/module_wrap.cc
index 8bd2c2c2c12..13dd331e6b2 100644
--- a/src/module_wrap.cc
+++ b/src/module_wrap.cc
@@ -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) {