2009-01-30 Miguel de Icaza <miguel@novell.com>
[mono.git] / mcs / class / System.Web / System.Web.UI / MinimizableAttributeTypeConverter.cs
index f33643591d17f8ac9250ec2f032041273702850c..fb09a94a160e343f5ea87cdab28cad219e48dfb6 100644 (file)
@@ -60,17 +60,15 @@ namespace System.Web.UI {
                public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value)
                {
                        // culture?
-                       if (value == null) {
-                               throw new NotSupportedException ("MinimizableAttributeTypeConverter cannot convert from (null)");
-                       }
-                                       
-                       Type t = value.GetType ();
-                       if (t == typeof (string))
-                               return ((string)value) != String.Empty;
-
-                       if (t == typeof (bool))
-                               return value;
+                       if (value != null) {                                    
+                               Type t = value.GetType ();
+                               if (t == typeof (string))
+                                       return ((string)value) != String.Empty;
 
+                               if (t == typeof (bool))
+                                       return value;
+                       }
+                       
                        return base.ConvertFrom (context, culture, value);
                }