-Fixed not erroring when reading undefined for nullable long

This commit is contained in:
James Newton-King
2017-07-23 13:50:49 +12:00
parent ad1a13728a
commit 403470d59a
8 changed files with 175 additions and 1 deletions
+7
View File
@@ -1190,6 +1190,13 @@ namespace Newtonsoft.Json
case ReadType.ReadAsInt32:
ReadAsInt32();
break;
case ReadType.ReadAsInt64:
bool result = ReadAndMoveToContent();
if (TokenType == JsonToken.Undefined)
{
throw JsonReaderException.Create(this, "An undefined token is not a valid {0}.".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType));
}
return result;
case ReadType.ReadAsDecimal:
ReadAsDecimal();
break;