From 5022adb6ad70d24d2d7491912e5ce2cad763f4ed Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Fri, 21 Oct 2011 14:25:14 +0000 Subject: [PATCH] Add handling for empty V8 exception messages (issue #342). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@331 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- libcef/v8_impl.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libcef/v8_impl.cc b/libcef/v8_impl.cc index 11e2b1766..eb69a4323 100644 --- a/libcef/v8_impl.cc +++ b/libcef/v8_impl.cc @@ -1030,10 +1030,15 @@ bool CefV8ValueImpl::ExecuteFunctionWithContext( v8::TryCatch try_catch; v8::Local func_rv = func->Call(recv, argc, argv); - if (try_catch.HasCaught()) - GetCefString(try_catch.Message()->Get(), exception); - else + if (try_catch.HasCaught()) { + v8::Local msg = try_catch.Message(); + if (msg.IsEmpty()) + exception = "CEF received an empty exception message."; + else + GetCefString(msg->Get(), exception); + } else { retval = new CefV8ValueImpl(func_rv); + } return true; }