diff options
author | cjihrig <cjihrig@gmail.com> | 2019-02-18 21:19:57 +0300 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2019-02-20 23:13:09 +0300 |
commit | 11a8a940d7bf03dc108082bdd456668210b949c1 (patch) | |
tree | b8c5c2511d8c052f51bd875881b856d2c13f0b79 /src/node_errors.cc | |
parent | 3d62d0c4804813ff36a051160a57fc4596804b8f (diff) |
report: simplify OnFatalError() handling
PR-URL: https://github.com/nodejs/node/pull/26191
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'src/node_errors.cc')
-rw-r--r-- | src/node_errors.cc | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/node_errors.cc b/src/node_errors.cc index 39673abf7f0..a17012b5b37 100644 --- a/src/node_errors.cc +++ b/src/node_errors.cc @@ -316,15 +316,9 @@ void OnFatalError(const char* location, const char* message) { Isolate* isolate = Isolate::GetCurrent(); HandleScope handle_scope(isolate); Environment* env = Environment::GetCurrent(isolate); - if (env != nullptr) { - std::shared_ptr<PerIsolateOptions> options = env->isolate_data()->options(); - if (options->report_on_fatalerror) { - report::TriggerNodeReport( - isolate, env, message, __func__, "", Local<String>()); - } - } else { + if (env == nullptr || env->isolate_data()->options()->report_on_fatalerror) { report::TriggerNodeReport( - isolate, nullptr, message, __func__, "", Local<String>()); + isolate, env, message, __func__, "", Local<String>()); } #endif // NODE_REPORT fflush(stderr); |