[Mono-bugs] [Bug 73113][Wis] New - NullReferenceException in System.Windows.Forms.TabPage:SetBoundsCore

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 28 Feb 2005 09:20:28 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by sbuehler@gmx.ch.

http://bugzilla.ximian.com/show_bug.cgi?id=73113

--- shadow/73113	2005-02-28 09:20:28.000000000 -0500
+++ shadow/73113.tmp.14295	2005-02-28 09:20:28.000000000 -0500
@@ -0,0 +1,39 @@
+Bug#: 73113
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Windows.Forms
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: sbuehler@gmx.ch               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: NullReferenceException in System.Windows.Forms.TabPage:SetBoundsCore
+
+In System.Windows.Forms.TabPage:SetBoundsCore, Owner should be tested to be
+different from null _before_ calling Owner.DisplayRectangle to avoid
+NullReferenceException:
+
+Index: TabPage.cs
+===================================================================
+--- TabPage.cs  (Revision 41280)
++++ TabPage.cs  (Arbeitskopie)
+@@ -194,9 +194,9 @@
+
+                protected override void SetBoundsCore (int x, int y, int
+width, int height, BoundsSpecified specified)
+                {
+-                       Rectangle display = Owner.DisplayRectangle;
+
+                        if (Owner != null && Owner.IsHandleCreated) {
++                               Rectangle display = Owner.DisplayRectangle;
+                                base.SetBoundsCore (display.X, display.Y,
+                                                        display.Width,
+display.Height,
+                                                        BoundsSpecified.All);