Bug 684927 - unchecked null pointer in nsMenuBarListener::KeyUp; r=smaug

This commit is contained in:
Jonas Sicking 2011-09-12 14:00:59 -04:00
Родитель 7162d85ae2
Коммит e197377366
1 изменённых файлов: 5 добавлений и 1 удалений

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

@ -141,6 +141,11 @@ nsMenuBarListener::ToggleMenuActiveState()
nsresult
nsMenuBarListener::KeyUp(nsIDOMEvent* aKeyEvent)
{
nsCOMPtr<nsIDOMKeyEvent> keyEvent = do_QueryInterface(aKeyEvent);
if (!keyEvent) {
return NS_OK;
}
InitAccessKey();
//handlers shouldn't be triggered by non-trusted events.
@ -159,7 +164,6 @@ nsMenuBarListener::KeyUp(nsIDOMEvent* aKeyEvent)
// On a press of the ALT key by itself, we toggle the menu's
// active/inactive state.
// Get the ascii key code.
nsCOMPtr<nsIDOMKeyEvent> keyEvent = do_QueryInterface(aKeyEvent);
PRUint32 theChar;
keyEvent->GetKeyCode(&theChar);