Fix deserializing mistmatched JToken types in properties (#2530)

This commit is contained in:
James Newton-King
2021-05-15 11:40:11 +12:00
committed by GitHub
parent f7e7bd05d9
commit 2b0f7a2492
2 changed files with 63 additions and 1 deletions
@@ -1113,7 +1113,8 @@ namespace Newtonsoft.Json.Serialization
if ((objectCreationHandling != ObjectCreationHandling.Replace)
&& (tokenType == JsonToken.StartArray || tokenType == JsonToken.StartObject || propertyConverter != null)
&& property.Readable)
&& property.Readable
&& property.PropertyContract?.ContractType != JsonContractType.Linq)
{
currentValue = property.ValueProvider!.GetValue(target);
gottenCurrentValue = true;