mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
src: guard against env != null in node_errors.cc
Otherwise `TriggerUncaughtException()` → `PrintException()` → `GetErrorSource()` can crash. PR-URL: https://github.com/nodejs/node/pull/36414 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
1 parent
681d2a7176
commit
6df1132c85
1 file changed
+1
-1
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user