-Fixed ReadAsBytes with type name handling

This commit is contained in:
James Newton-King
2016-01-08 22:37:05 +13:00
parent 2c5322c302
commit 70120ce077
4 changed files with 91 additions and 2 deletions
+7 -1
View File
@@ -523,7 +523,13 @@ namespace Newtonsoft.Json
ReadIntoWrappedTypeObject();
byte[] data = ReadAsBytes();
Read();
ReaderReadAndAssert();
if (TokenType != JsonToken.EndObject)
{
throw JsonReaderException.Create(this, "Error reading bytes. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, TokenType));
}
SetToken(JsonToken.Bytes, data, false);
return data;
}