Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3235)

Unified Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 408813004: PPAPI: Check for NULL before calling WebBindings::evaluate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: improve comment Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/pepper_plugin_instance_impl.cc
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc
index a1116811924e0ad9789ef791752b8a1de7341d0c..15fa1fe0d23f3fa43b76336a3181e0f7ff931dcd 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -2384,9 +2384,11 @@ PP_Var PepperPluginInstanceImpl::ExecuteScript(PP_Instance instance,
np_script.UTF8Length = script_string->value().length();
// Get the current frame to pass to the evaluate function.
- WebLocalFrame* frame = container_->element().document().frame();
- if (!frame) {
- try_catch.SetException("No frame to execute script in.");
+ WebLocalFrame* frame = NULL;
+ if (container_)
+ frame = container_->element().document().frame();
+ if (!frame || !frame->windowObject()) {
+ try_catch.SetException("No context in which to execute script.");
return PP_MakeUndefined();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698