Throw for CheckAdditionalContent when extra content is preceded by comments. (#1183)
Fixes #1182
This commit is contained in:
committed by
James Newton-King
parent
7e4b3448c7
commit
9727996b1a
@@ -169,9 +169,12 @@ namespace Newtonsoft.Json.Serialization
|
||||
|
||||
if (checkAdditionalContent)
|
||||
{
|
||||
if (reader.Read() && reader.TokenType != JsonToken.Comment)
|
||||
while (reader.Read())
|
||||
{
|
||||
throw new JsonSerializationException("Additional text found in JSON string after finishing deserializing object.");
|
||||
if (reader.TokenType != JsonToken.Comment)
|
||||
{
|
||||
throw new JsonSerializationException("Additional text found in JSON string after finishing deserializing object.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user