Skip to content

Commit 0e89d7a

Browse files
cjihrigrvagg
authored andcommitted
report: simplify OnFatalError() handling
PR-URL: #26191 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent dff0149 commit 0e89d7a

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/node_errors.cc

+2-8
Original file line numberDiff line numberDiff line change
@@ -316,15 +316,9 @@ void OnFatalError(const char* location, const char* message) {
316316
Isolate* isolate = Isolate::GetCurrent();
317317
HandleScope handle_scope(isolate);
318318
Environment* env = Environment::GetCurrent(isolate);
319-
if (env != nullptr) {
320-
std::shared_ptr<PerIsolateOptions> options = env->isolate_data()->options();
321-
if (options->report_on_fatalerror) {
322-
report::TriggerNodeReport(
323-
isolate, env, message, __func__, "", Local<String>());
324-
}
325-
} else {
319+
if (env == nullptr || env->isolate_data()->options()->report_on_fatalerror) {
326320
report::TriggerNodeReport(
327-
isolate, nullptr, message, __func__, "", Local<String>());
321+
isolate, env, message, __func__, "", Local<String>());
328322
}
329323
#endif // NODE_REPORT
330324
fflush(stderr);

0 commit comments

Comments
 (0)