Skip to content

Commit 6df1132

Browse files
addaleaxtargos
authored andcommitted
src: guard against env != null in node_errors.cc
Otherwise `TriggerUncaughtException()` → `PrintException()` → `GetErrorSource()` can crash. PR-URL: #36414 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Shelley Vohr <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 681d2a7 commit 6df1132

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node_errors.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static std::string GetErrorSource(Isolate* isolate,
6262
Environment* env = Environment::GetCurrent(isolate);
6363
const bool has_source_map_url =
6464
!message->GetScriptOrigin().SourceMapUrl().IsEmpty();
65-
if (has_source_map_url && env->source_maps_enabled()) {
65+
if (has_source_map_url && env != nullptr && env->source_maps_enabled()) {
6666
return sourceline;
6767
}
6868

0 commit comments

Comments
 (0)