Author: jpobst
Date: 2006-12-11 15:02:38 -0500 (Mon, 11 Dec 2006)
New Revision: 69356
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
Log:
2006-12-11 Jonathan Pobst <[EMAIL PROTECTED]>
* Control.cs: Fix NRE if Control.Site was set to null.
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-12-11 20:00:28 UTC (rev 69355)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-12-11 20:02:38 UTC (rev 69356)
@@ -1,3 +1,7 @@
+2006-12-11 Jonathan Pobst <[EMAIL PROTECTED]>
+
+ * Control.cs: Fix NRE if Control.Site was set to null.
+
2006-12-11 Chris Toshok <[EMAIL PROTECTED]>
* Control.cs: ControlCollection.Remove should return if the arg is
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
2006-12-11 20:00:28 UTC (rev 69355)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
2006-12-11 20:02:38 UTC (rev 69356)
@@ -2359,12 +2359,14 @@
set {
base.Site = value;
- AmbientProperties ap = (AmbientProperties)
value.GetService (typeof (AmbientProperties));
- if (ap != null) {
- BackColor = ap.BackColor;
- ForeColor = ap.ForeColor;
- Cursor = ap.Cursor;
- Font = ap.Font;
+ if (value != null) {
+ AmbientProperties ap =
(AmbientProperties) value.GetService (typeof (AmbientProperties));
+ if (ap != null) {
+ BackColor = ap.BackColor;
+ ForeColor = ap.ForeColor;
+ Cursor = ap.Cursor;
+ Font = ap.Font;
+ }
}
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches