From 48d5da7827435d9f675e3e8a6e9020e2701ddb08 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Fri, 18 Nov 2011 17:43:12 +0000 Subject: [PATCH] Add check for failed V8 function creation in CefV8Value::CreateFunction(). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@387 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- libcef/v8_impl.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libcef/v8_impl.cc b/libcef/v8_impl.cc index 18e557cd3..72a1554c6 100644 --- a/libcef/v8_impl.cc +++ b/libcef/v8_impl.cc @@ -633,6 +633,11 @@ CefRefPtr CefV8Value::CreateFunction(const CefString& name, // Retrieve the function object and set the name. v8::Local func = tmpl->GetFunction(); + if (func.IsEmpty()) { + NOTREACHED() << "failed to create function"; + return NULL; + } + func->SetName(GetV8String(name)); // Attach the handler instance to the V8 object.