Bug 1273128 - prevent null pointer dereference on |nativeKeyEvent|. r?janv
MozReview-Commit-ID: IOnUZfZHcnG
--- a/layout/xul/nsMenuBarListener.cpp
+++ b/layout/xul/nsMenuBarListener.cpp
@@ -206,17 +206,17 @@ nsMenuBarListener::KeyPress(nsIDOMEvent*
InitAccessKey();
if (mAccessKey)
{
// If accesskey handling was forwarded to a child process, wait for
// the mozaccesskeynotfound event before handling accesskeys.
WidgetKeyboardEvent* nativeKeyEvent =
aKeyEvent->WidgetEventPtr()->AsKeyboardEvent();
- if (nativeKeyEvent->mAccessKeyForwardedToChild) {
+ if (nativeKeyEvent && nativeKeyEvent->mAccessKeyForwardedToChild) {
return NS_OK;
}
nsCOMPtr<nsIDOMKeyEvent> keyEvent = do_QueryInterface(aKeyEvent);
uint32_t keyCode, charCode;
keyEvent->GetKeyCode(&keyCode);
keyEvent->GetCharCode(&charCode);