summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);