From e117097e1f1f8a3cddaac9fb71d86661b6a10b22 Mon Sep 17 00:00:00 2001 From: Everaldo Canuto Date: Wed, 1 Oct 2008 13:20:38 +0000 Subject: [PATCH] In System.Windows.Forms: 2008-09-30 Everaldo Canuto * MenuAPI.cs: Prevent NRE when deactivate menu. Fixes #413636. svn path=/branches/mono-2-0/mcs/; revision=114557 --- mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 4 ++++ mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 8ef5c0c9adc..702759cd349 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,7 @@ +2008-09-30 Everaldo Canuto + + * MenuAPI.cs: Prevent NRE when deactivate menu. Fixes #413636. + 2008-09-08 Ivan N. Zlatev * ErrorProvider.cs: Unbreak my previous commit. diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs index 2cca05d899f..e496db29e53 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs @@ -93,7 +93,8 @@ namespace System.Windows.Forms { active = false; popup_active = false; hotkey_active = false; - GrabControl.ActiveTracker = null; + if (GrabControl != null) + GrabControl.ActiveTracker = null; keynav_state = KeyNavState.Idle; if (TopMenu is ContextMenu) { PopUpWindow puw = TopMenu.Wnd as PopUpWindow; -- 2.11.4.GIT