From abfd51107f526e41d90ef67e3815713f1852cf49 Mon Sep 17 00:00:00 2001 From: Steve Harter Date: Tue, 10 Sep 2019 17:15:36 -0500 Subject: [PATCH] NetFx --- .../src/System/Text/Json/Serialization/JsonClassInfo.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/System.Text.Json/src/System/Text/Json/Serialization/JsonClassInfo.cs b/src/System.Text.Json/src/System/Text/Json/Serialization/JsonClassInfo.cs index 8d313a2fb773..3e754b5bbcc2 100644 --- a/src/System.Text.Json/src/System/Text/Json/Serialization/JsonClassInfo.cs +++ b/src/System.Text.Json/src/System/Text/Json/Serialization/JsonClassInfo.cs @@ -332,8 +332,7 @@ public JsonPropertyInfo GetProperty(ReadOnlySpan propertyName, ref ReadSta // No cached item was found. Try the main list which has all of the properties. string stringPropertyName = JsonHelpers.Utf8GetString(propertyName); - - JsonPropertyInfo info = PropertyCache.GetValueOrDefault(stringPropertyName); + PropertyCache.TryGetValue(stringPropertyName, out JsonPropertyInfo info); // Three code paths to get here: // 1) info == null. Property not found.