Skip to content

Commit f3a7f81

Browse files
committed
src: guard against env != null in node_errors.cc
Otherwise `TriggerUncaughtException()` → `PrintException()` → `GetErrorSource()` can crash.
1 parent 20de5f7 commit f3a7f81

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
@@ -63,7 +63,7 @@ static std::string GetErrorSource(Isolate* isolate,
6363
Environment* env = Environment::GetCurrent(isolate);
6464
const bool has_source_map_url =
6565
!message->GetScriptOrigin().SourceMapUrl().IsEmpty();
66-
if (has_source_map_url && env->source_maps_enabled()) {
66+
if (has_source_map_url && env != nullptr && env->source_maps_enabled()) {
6767
return sourceline;
6868
}
6969

0 commit comments

Comments
 (0)