Commit 3c893eca authored by dmichael@chromium.org's avatar dmichael@chromium.org

PPAPI: Check for NULL before calling WebBindings::evaluate

BUG=395288

Review URL: https://codereview.chromium.org/408813004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284779 0039d316-1c4b-4281-b951-d872f2087c98
parent dbec7b14
...@@ -2384,9 +2384,11 @@ PP_Var PepperPluginInstanceImpl::ExecuteScript(PP_Instance instance, ...@@ -2384,9 +2384,11 @@ PP_Var PepperPluginInstanceImpl::ExecuteScript(PP_Instance instance,
np_script.UTF8Length = script_string->value().length(); np_script.UTF8Length = script_string->value().length();
// Get the current frame to pass to the evaluate function. // Get the current frame to pass to the evaluate function.
WebLocalFrame* frame = container_->element().document().frame(); WebLocalFrame* frame = NULL;
if (!frame) { if (container_)
try_catch.SetException("No frame to execute script in."); frame = container_->element().document().frame();
if (!frame || !frame->windowObject()) {
try_catch.SetException("No context in which to execute script.");
return PP_MakeUndefined(); return PP_MakeUndefined();
} }
......
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