diff --git a/Src/Newtonsoft.Json/JsonSerializer.cs b/Src/Newtonsoft.Json/JsonSerializer.cs index 9e89733d..4db23a49 100644 --- a/Src/Newtonsoft.Json/JsonSerializer.cs +++ b/Src/Newtonsoft.Json/JsonSerializer.cs @@ -389,7 +389,7 @@ namespace Newtonsoft.Json { Type converterType; - if (!ConverterTypeCache.ContainsKey(attributeProvider)) + if (!ConverterTypeCache.TryGetValue(attributeProvider, out converterType)) { JsonConverterAttribute converterAttribute = ReflectionUtils.GetAttribute(attributeProvider, true); converterType = (converterAttribute != null) @@ -398,10 +398,6 @@ namespace Newtonsoft.Json ConverterTypeCache[attributeProvider] = converterType; } - else - { - converterType = ConverterTypeCache[attributeProvider]; - } if (converterType != null) {