diff --git a/src/node_errors.cc b/src/node_errors.cc index 813bc3fd8e0..0ec100986e8 100644 --- a/src/node_errors.cc +++ b/src/node_errors.cc @@ -62,7 +62,7 @@ static std::string GetErrorSource(Isolate* isolate, Environment* env = Environment::GetCurrent(isolate); const bool has_source_map_url = !message->GetScriptOrigin().SourceMapUrl().IsEmpty(); - if (has_source_map_url && env->source_maps_enabled()) { + if (has_source_map_url && env != nullptr && env->source_maps_enabled()) { return sourceline; }