Null pointer check if no default plugin. part of patch for bug 54437 a=av sr=buster

This commit is contained in:
peterlubczynski%netscape.com 2001-01-10 23:51:07 +00:00
parent 0402acedf2
commit 8d852ff6bc
2 changed files with 8 additions and 2 deletions

View File

@ -2487,8 +2487,11 @@ nsPluginInstanceOwner::HandleEvent(nsIDOMEvent* aEvent)
nsEventStatus nsPluginInstanceOwner::ProcessEvent(const nsGUIEvent& anEvent) nsEventStatus nsPluginInstanceOwner::ProcessEvent(const nsGUIEvent& anEvent)
{ {
nsEventStatus rv = nsEventStatus_eIgnore; nsEventStatus rv = nsEventStatus_eIgnore;
if (!mInstance) // if mInstance is null, we shouldn't be here
return rv;
#ifdef XP_MAC #ifdef XP_MAC
if (mInstance != NULL) { if (mWidget != NULL) { // check for null mWidget
EventRecord* event = (EventRecord*)anEvent.nativeMsg; EventRecord* event = (EventRecord*)anEvent.nativeMsg;
if (event == NULL || event->what == nullEvent) { if (event == NULL || event->what == nullEvent) {
EventRecord macEvent; EventRecord macEvent;

View File

@ -2487,8 +2487,11 @@ nsPluginInstanceOwner::HandleEvent(nsIDOMEvent* aEvent)
nsEventStatus nsPluginInstanceOwner::ProcessEvent(const nsGUIEvent& anEvent) nsEventStatus nsPluginInstanceOwner::ProcessEvent(const nsGUIEvent& anEvent)
{ {
nsEventStatus rv = nsEventStatus_eIgnore; nsEventStatus rv = nsEventStatus_eIgnore;
if (!mInstance) // if mInstance is null, we shouldn't be here
return rv;
#ifdef XP_MAC #ifdef XP_MAC
if (mInstance != NULL) { if (mWidget != NULL) { // check for null mWidget
EventRecord* event = (EventRecord*)anEvent.nativeMsg; EventRecord* event = (EventRecord*)anEvent.nativeMsg;
if (event == NULL || event->what == nullEvent) { if (event == NULL || event->what == nullEvent) {
EventRecord macEvent; EventRecord macEvent;