Author: rtyler
Date: 2007-10-20 07:33:55 -0400 (Sat, 20 Oct 2007)
New Revision: 87848

Modified:
   
trunk/mcs/class/System.Web.Extensions/System.Web.Script.Serialization/JavaScriptSerializer.cs
Log:
Gak, forgot to move the code after the null check on 'type'`


Modified: 
trunk/mcs/class/System.Web.Extensions/System.Web.Script.Serialization/JavaScriptSerializer.cs
===================================================================
--- 
trunk/mcs/class/System.Web.Extensions/System.Web.Script.Serialization/JavaScriptSerializer.cs
       2007-10-20 11:30:19 UTC (rev 87847)
+++ 
trunk/mcs/class/System.Web.Extensions/System.Web.Script.Serialization/JavaScriptSerializer.cs
       2007-10-20 11:33:55 UTC (rev 87848)
@@ -206,18 +206,6 @@
                        if (obj is IEnumerable<object>)
                                return ConvertToList ((IEnumerable<object>) 
obj, type);
 
-                       /*
-                        * Take care of the special case whereas in JSON an 
empty string ("") really means 
-                        * an empty value 
-                        * (see: 
https://bugzilla.novell.com/show_bug.cgi?id=328836)
-                        */
-                       if ( (type.IsGenericType) && 
(type.GetGenericTypeDefinition() == typeof(Nullable<>)) )
-                       {
-                               string s = obj as String;
-                               if (String.IsNullOrEmpty(s))
-                                               return null;
-                       }
-
                        if (type == null)
                                return obj;
 
@@ -236,6 +224,18 @@
                                return c.ConvertFrom (obj);
                        }
 
+                       /*
+                        * Take care of the special case whereas in JSON an 
empty string ("") really means 
+                        * an empty value 
+                        * (see: 
https://bugzilla.novell.com/show_bug.cgi?id=328836)
+                        */
+                       if ( (type.IsGenericType) && 
(type.GetGenericTypeDefinition() == typeof(Nullable<>)) )
+                       {
+                               string s = obj as String;
+                               if (String.IsNullOrEmpty(s))
+                                               return null;
+                       }
+
                        return Convert.ChangeType (obj, type);
                }
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to