diff options
author | Leon Scroggins <scroggo@google.com> | 2009-06-04 16:48:39 -0400 |
---|---|---|
committer | Leon Scroggins <scroggo@google.com> | 2009-06-04 16:48:39 -0400 |
commit | c00e40c969f337a4e72d3ecae0669bb334eec713 (patch) | |
tree | a5dd8293cecaef37b0c990064b826cc4c78caaf6 | |
parent | f886bc57020d37942e84b74ff878bdc1498a09c7 (diff) | |
download | external_webkit-c00e40c969f337a4e72d3ecae0669bb334eec713.zip external_webkit-c00e40c969f337a4e72d3ecae0669bb334eec713.tar.gz external_webkit-c00e40c969f337a4e72d3ecae0669bb334eec713.tar.bz2 |
Fix a crash on missing plugins.
Before accessing the plugin package, make sure it is not null, since
missing plugins will not have one.
-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; } |