summaryrefslogtreecommitdiffstats
path: root/views/controls/menu/native_menu_win.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-10 21:13:44 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-10 21:13:44 +0000
commitfd6e5b81fdc1ab2b5ae1fb585c0b891800d5b00c (patch)
treee9b104f23392d33704d053323e242064395e00ec /views/controls/menu/native_menu_win.cc
parent6e92d9aac3ba3a12b1f1612e02565a979e5b7382 (diff)
downloadchromium_src-fd6e5b81fdc1ab2b5ae1fb585c0b891800d5b00c.zip
chromium_src-fd6e5b81fdc1ab2b5ae1fb585c0b891800d5b00c.tar.gz
chromium_src-fd6e5b81fdc1ab2b5ae1fb585c0b891800d5b00c.tar.bz2
Fixes crash in menu. It's possible for the WM_MENUSELECT to pass in
NULL as the menu on XP. I believe this only happens when closing the menu, so that it doesn't really matter what we do here. BUG=13759 TEST=see bug Review URL: http://codereview.chromium.org/119441 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18084 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/menu/native_menu_win.cc')
-rw-r--r--views/controls/menu/native_menu_win.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/views/controls/menu/native_menu_win.cc b/views/controls/menu/native_menu_win.cc
index bbdd46a..c82844e 100644
--- a/views/controls/menu/native_menu_win.cc
+++ b/views/controls/menu/native_menu_win.cc
@@ -98,6 +98,9 @@ class NativeMenuWin::MenuHostWindow {
// Called as the user moves their mouse or arrows through the contents of the
// menu.
void OnMenuSelect(WPARAM w_param, HMENU menu) {
+ if (!menu)
+ return; // menu is null when closing on XP.
+
int position = GetMenuItemIndexFromWPARAM(menu, w_param);
if (position >= 0)
GetNativeMenuWinFromHMENU(menu)->model_->HighlightChangedTo(position);