Commit 73253d42 authored by Wael Al Jishi's avatar Wael Al Jishi Committed by Commit Bot

Ensure isolate exists in ReportApiFailure

This avoids a segfault rather than reporting the (API usage)
error message:
"Fatal error in v8::HandleScope::CreateHandle() Cannot create a
handle without a HandleScope"


Bug: 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I68a3d77ca37cc09d9e70526008a072dee8973000
Reviewed-on: https://chromium-review.googlesource.com/832488
Commit-Queue: Wael Al Jishi <waelj@google.com>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50485}
parent ff0abec8
......@@ -402,7 +402,10 @@ void i::V8::FatalProcessOutOfMemory(const char* location, bool is_heap_oom) {
void Utils::ReportApiFailure(const char* location, const char* message) {
i::Isolate* isolate = i::Isolate::Current();
FatalErrorCallback callback = isolate->exception_behavior();
FatalErrorCallback callback = nullptr;
if (isolate != nullptr) {
callback = isolate->exception_behavior();
}
if (callback == nullptr) {
base::OS::PrintError("\n#\n# Fatal error in %s\n# %s\n#\n\n", location,
message);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment