Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs/class
diff options
context:
space:
mode:
authorDick Porter <dick@acm.org>2010-06-24 18:01:38 +0400
committerDick Porter <dick@acm.org>2010-06-24 18:01:38 +0400
commit35c212adfbf632d6817efaf5eb7467b06233727a (patch)
tree15be85183fbaa10b48dc1fed55b0393bd31d6d5c /mcs/class
parent84d9d1b63f8e46fb3e305e249e387545036960ce (diff)
2010-06-24 Dick Porter <dporter@codicesoftware.com>
* Fix NullReferenceException when keyboard shortcut activates disabled context menu item. Fixes bug 615940. svn path=/branches/mono-2-6/mcs/; revision=159499
Diffstat (limited to 'mcs/class')
-rw-r--r--mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog5
-rw-r--r--mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs6
2 files changed, 10 insertions, 1 deletions
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
index dacfc30f87d..0a7b7653adc 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
@@ -1,3 +1,8 @@
+2010-06-24 Dick Porter <dporter@codicesoftware.com>
+
+ * Fix NullReferenceException when keyboard shortcut activates
+ disabled context menu item. Fixes bug 615940.
+
2010-06-22 Dick Porter <dporter@codicesoftware.com>
* TextControl.cs, XplatUIX11.cs, XplatUICarbon.cs: Expand paint
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 b412ac1c10d..b2e0c75485c 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs
@@ -115,8 +115,12 @@ namespace System.Windows.Forms {
{
if (menu is MainMenu)
pt = ScreenToMenu (menu, pt);
- else
+ else {
+ if (menu.Wnd == null) {
+ return null;
+ }
pt = menu.Wnd.PointToClient (pt);
+ }
foreach (MenuItem item in menu.MenuItems) {
Rectangle rect = item.bounds;
if (rect.Contains (pt))