Bug 1276901 - prevent null pointer dereference on |nativeKeyEvent|. r=dholbert

MozReview-Commit-ID: J3GtMQDU1Yq

--HG--
extra : rebase_source : 7c4ea962e66be1a084cfc2d765cdee79d726d40e
This commit is contained in:
Andi-Bogdan Postelnicu 2016-05-31 15:41:12 +03:00
Родитель ded9e69625
Коммит fb9e09b56b
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -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;
}