You've already forked linux-packaging-mono
Imported Upstream version 3.8.0
Former-commit-id: 6a76a29bd07d86e57c6c8da45c65ed5447d38a61
This commit is contained in:
@ -180,16 +180,20 @@ namespace System.Web.Script.Serialization
|
||||
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 ((targetType.IsGenericType) && (targetType.GetGenericTypeDefinition() == typeof(Nullable<>)))
|
||||
{
|
||||
string s = obj as String;
|
||||
if (String.IsNullOrEmpty(s))
|
||||
if ((targetType.IsGenericType) && (targetType.GetGenericTypeDefinition () == typeof (Nullable<>))) {
|
||||
if (obj is String) {
|
||||
/*
|
||||
* 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(String.IsNullOrEmpty ((String)obj))
|
||||
return null;
|
||||
} else if (c.CanConvertFrom (typeof (string))) {
|
||||
TypeConverter objConverter = TypeDescriptor.GetConverter (obj);
|
||||
string s = objConverter.ConvertToInvariantString (obj);
|
||||
return c.ConvertFromInvariantString (s);
|
||||
}
|
||||
}
|
||||
|
||||
return Convert.ChangeType (obj, targetType);
|
||||
|
Reference in New Issue
Block a user