summaryrefslogtreecommitdiff
path: root/chromium/content/renderer/npapi/webplugin_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/content/renderer/npapi/webplugin_impl.cc')
-rw-r--r--chromium/content/renderer/npapi/webplugin_impl.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/chromium/content/renderer/npapi/webplugin_impl.cc b/chromium/content/renderer/npapi/webplugin_impl.cc
index 32e35523121..f02d0d76c18 100644
--- a/chromium/content/renderer/npapi/webplugin_impl.cc
+++ b/chromium/content/renderer/npapi/webplugin_impl.cc
@@ -258,8 +258,12 @@ bool WebPluginImpl::initialize(WebPluginContainer* container) {
blink::WebPlugin* replacement_plugin =
GetContentClient()->renderer()->CreatePluginReplacement(
render_frame_, file_path_);
- if (!replacement_plugin)
+ if (!replacement_plugin) {
+ // Maintain invariant that container() returns null when initialize()
+ // returns false.
+ SetContainer(nullptr);
return false;
+ }
// Disable scripting by this plugin before replacing it with the new
// one. This plugin also needs destroying, so use destroy(), which will