Handle empty v8::TryCatch messages in CFXJSE_Context.
Change-Id: I933ede1401cebc83c1f9b75150798bac77af6122
Reviewed-on: https://pdfium-review.googlesource.com/c/46891
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/fxjs/cfxjse_context.cpp b/fxjs/cfxjse_context.cpp
index e80d0c9..8f490b1 100644
--- a/fxjs/cfxjse_context.cpp
+++ b/fxjs/cfxjse_context.cpp
@@ -61,9 +61,12 @@
if (!trycatch->HasCaught())
return hReturnValue;
+ v8::Local<v8::Message> hMessage = trycatch->Message();
+ if (hMessage.IsEmpty())
+ return hReturnValue;
+
v8::Local<v8::Context> context = pIsolate->GetCurrentContext();
v8::Local<v8::Value> hException = trycatch->Exception();
- v8::Local<v8::Message> hMessage = trycatch->Message();
if (hException->IsObject()) {
v8::Local<v8::String> hNameStr =
v8::String::NewFromUtf8(pIsolate, "name", v8::NewStringType::kNormal)