Commit ccf08103 authored by dmazzoni@chromium.org's avatar dmazzoni@chromium.org

Fix NOTREACHED triggered by MenuItemView::GetAcceleratorText

A recent change to accessibility on Chrome OS is triggering a call to
MenuItemView::GetAccessibleState on a MenuItemView that has a delegate
but no command id, which asserts in MenuModelAdapter when we try to
look up a command that's not there.

The fix is to not call MenuModelAdapter::GetAccelerator to look up a
command when the command is zero.

BUG=230107,232079

Review URL: https://codereview.chromium.org/14161006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194665 0039d316-1c4b-4281-b951-d872f2087c98
parent c99e08a3
......@@ -1009,7 +1009,7 @@ string16 MenuItemView::GetAcceleratorText() {
return string16();
ui::Accelerator accelerator;
return (GetDelegate() &&
return (GetDelegate() && GetCommand() &&
GetDelegate()->GetAccelerator(GetCommand(), &accelerator)) ?
accelerator.GetShortcutText() : string16();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment