diff --git a/layout/xul/nsMenuBarListener.cpp b/layout/xul/nsMenuBarListener.cpp index 35a33ba0661f..0fce497b80b1 100644 --- a/layout/xul/nsMenuBarListener.cpp +++ b/layout/xul/nsMenuBarListener.cpp @@ -211,7 +211,8 @@ nsMenuBarListener::KeyPress(nsIDOMEvent* aKeyEvent) // the mozaccesskeynotfound event before handling accesskeys. WidgetKeyboardEvent* nativeKeyEvent = aKeyEvent->WidgetEventPtr()->AsKeyboardEvent(); - if (nativeKeyEvent && nativeKeyEvent->mAccessKeyForwardedToChild) { + if (!nativeKeyEvent || + (nativeKeyEvent && nativeKeyEvent->mAccessKeyForwardedToChild)) { return NS_OK; }