2007-12-02 Jonathan Pobst <monkey@jpobst.com>
authorJonathan Pobst <monkey@jpobst.com>
Mon, 3 Dec 2007 05:02:21 +0000 (05:02 -0000)
committerJonathan Pobst <monkey@jpobst.com>
Mon, 3 Dec 2007 05:02:21 +0000 (05:02 -0000)
* ToolStripManager.cs: Guard against an NRE I ran into.

svn path=/trunk/mcs/; revision=90539

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripManager.cs

index e01babc0c51435433e83819a1a4fd558a8986c75..c1526d0b2d1944ed9f490c2f9284b33ba545ead4 100644 (file)
@@ -1,3 +1,7 @@
+2007-12-02  Jonathan Pobst  <monkey@jpobst.com>
+
+       * ToolStripManager.cs: Guard against an NRE I ran into.
+
 2007-12-02  Jonathan Pobst  <monkey@jpobst.com>
 
        * LinkLabel.cs: Apply patch from George to fix bug 344012.  If
index cb75136dada9fbfc66a355e3d335228082f6af23..6e4e32a6a2d2d3bdff25fd4535c3180b384d8ddc 100644 (file)
@@ -507,6 +507,10 @@ namespace System.Windows.Forms
                        // Get the parent form of this message
                        Form f = (Form)Control.FromHandle (m.HWnd).TopLevelControl;
 
+                       // If there isn't a Form with this, there isn't much we can do
+                       if (f == null)
+                               return false;
+                               
                        // Check the MainMenuStrip property first
                        if (f.MainMenuStrip != null)
                                if (f.MainMenuStrip.OnMenuKey ())