Преглед изворни кода

2006-04-25 Miguel de Icaza <[email protected]>

	* TypeConverter.cs (ConvertFrom): Do not crash if we are passed a
	null value. 

svn path=/trunk/mcs/; revision=59887
Miguel de Icaza пре 19 година
родитељ
комит
033abbfaaa

+ 5 - 0
mcs/class/System/System.ComponentModel/ChangeLog

@@ -1,3 +1,8 @@
+2006-04-25  Miguel de Icaza  <[email protected]>
+
+	* TypeConverter.cs (ConvertFrom): Do not crash if we are passed a
+	null value. 
+
 2006-04-25  Atsushi Enomoto  <[email protected]>
 
 	* BaseNumberConverter.cs : (ConvertTo) regardless of InnerType,

+ 1 - 1
mcs/class/System/System.ComponentModel/TypeConverter.cs

@@ -77,7 +77,7 @@ namespace System.ComponentModel
 			}
 
 			throw new NotSupportedException (this.ToString() + " cannot be created from '" +
-						         value.GetType().ToString() + "'");
+						         value == null ? "null" : value.GetType().ToString() + "'");
 		}
 
 		public object ConvertFromInvariantString (string text)