-Fixed error when deserializing nullable types with no content

-Changed JsonReaders to set TokenType to JsonToken.None after finishing content
-Changed the ReadAsXXX methods to return null instead of throwing an error when there is no content
This commit is contained in:
James Newton-King
2012-02-19 01:25:47 +13:00
parent c876e1d9cc
commit 4f8832adc0
11 changed files with 240 additions and 26 deletions
+2
View File
@@ -722,6 +722,8 @@ namespace Newtonsoft.Json
/// <returns>The deserialized object from the JSON string.</returns>
public static object DeserializeObject(string value, Type type, JsonSerializerSettings settings)
{
ValidationUtils.ArgumentNotNull(value, "value");
StringReader sr = new StringReader(value);
JsonSerializer jsonSerializer = JsonSerializer.Create(settings);