if (!mInstance || !mWindow)
if (!mInstance || !mWindow || anEvent.message == NS_MENU_SELECTED)
nsEventStatus pluginInstanceOwner::ProcessEvent(const nsGUIEvent& anEvent){  nsEventStatus rv = nsEventStatus_eIgnore;  if (!mInstance || !mWindow)   // if the instance or the window is null, we shouldn't be here    return rv;#ifdef XP_MAC    //if (mWidget != NULL) {  // check for null mWidget        EventRecord* event = (EventRecord*)anEvent.nativeMsg;        if (event == NULL || event->what == nullEvent ||            anEvent.message == NS_KEY_PRESS           ||            anEvent.message == NS_CONTEXTMENU_MESSAGE_START) {            EventRecord macEvent;            GUItoMacEvent(anEvent, macEvent);            event = &macEvent;            if (event->what == updateEvt) {                nsPluginPort* pluginPort = GetPluginPort();                // Add in child windows absolute position to get make the dirty rect                // relative to the top-level window.                FixUpPluginWindow();                                EventRecord updateEvent;                InitializeEventRecord(&updateEvent);                updateEvent.what = updateEvt;                updateEvent.message = UInt32(pluginPort->port);                nsPluginEvent pluginEvent = { &updateEvent, nsPluginPlatformWindowRef(pluginPort->port) };                PRBool eventHandled = PR_FALSE;                mInstance->HandleEvent(&pluginEvent, &eventHandled);            }            return nsEventStatus_eConsumeNoDefault;                    }        nsPluginPort* port = (nsPluginPort*)mWindow->GetNativeData(NS_NATIVE_PLUGIN_PORT);        nsPluginEvent pluginEvent = { event, nsPluginPlatformWindowRef(port->port) };        PRBool eventHandled = PR_FALSE;        mInstance->HandleEvent(&pluginEvent, &eventHandled);        if (eventHandled && anEvent.message != NS_MOUSE_LEFT_BUTTON_DOWN)            rv = nsEventStatus_eConsumeNoDefault;   // }#endif//~~~#ifdef XP_WIN        nsPluginEvent * pPluginEvent = (nsPluginEvent *)anEvent.nativeMsg;        if (pPluginEvent) {            PRBool eventHandled = PR_FALSE;            mInstance->HandleEvent(pPluginEvent, &eventHandled);            if (eventHandled)                rv = nsEventStatus_eConsumeNoDefault;        }#endif  return rv;}