diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-06-04 14:09:20 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-06-04 14:09:20 -0700 |
commit | a867814021aa8ded5698353a900bae42fb816402 (patch) | |
tree | 0805952f150c39e42f6f3ff73b4e2da01c015ec6 | |
parent | 08ccebc1045cc42af60d01c19ce6ce27ca616604 (diff) | |
parent | c00e40c969f337a4e72d3ecae0669bb334eec713 (diff) | |
download | external_webkit-a867814021aa8ded5698353a900bae42fb816402.zip external_webkit-a867814021aa8ded5698353a900bae42fb816402.tar.gz external_webkit-a867814021aa8ded5698353a900bae42fb816402.tar.bz2 |
Merge change 3201
* changes:
Fix a crash on missing plugins.
-rw-r--r-- | WebKit/android/plugins/PluginWidgetAndroid.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/WebKit/android/plugins/PluginWidgetAndroid.cpp b/WebKit/android/plugins/PluginWidgetAndroid.cpp index 4dc361e..3c765ec 100644 --- a/WebKit/android/plugins/PluginWidgetAndroid.cpp +++ b/WebKit/android/plugins/PluginWidgetAndroid.cpp @@ -146,9 +146,13 @@ void PluginWidgetAndroid::draw(SkCanvas* canvas) { bool PluginWidgetAndroid::sendEvent(const ANPEvent& evt) { WebCore::PluginPackage* pkg = m_pluginView->plugin(); NPP instance = m_pluginView->instance(); - // make a localCopy since the actual plugin may not respect its constness, - // and so we don't want our caller to have its param modified - ANPEvent localCopy = evt; - return pkg->pluginFuncs()->event(instance, &localCopy); + // "missing" plugins won't have these + if (pkg && instance) { + // make a localCopy since the actual plugin may not respect its constness, + // and so we don't want our caller to have its param modified + ANPEvent localCopy = evt; + return pkg->pluginFuncs()->event(instance, &localCopy); + } + return false; } |