From 35096fd583e360a5d410b7bb835ecfed05d2e292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Standa=20Luke=C5=A1?= Date: Wed, 18 Jan 2023 12:28:22 +0100 Subject: [PATCH] Fix type metadata cache --- .../ViewModel/Serialization/ViewModelTypeMetadataSerializer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Framework/Framework/ViewModel/Serialization/ViewModelTypeMetadataSerializer.cs b/src/Framework/Framework/ViewModel/Serialization/ViewModelTypeMetadataSerializer.cs index a7ff234cc3..9cdf4caa1b 100644 --- a/src/Framework/Framework/ViewModel/Serialization/ViewModelTypeMetadataSerializer.cs +++ b/src/Framework/Framework/ViewModel/Serialization/ViewModelTypeMetadataSerializer.cs @@ -105,7 +105,7 @@ private JObject GetEnumTypeMetadataCopy(Type type) private ObjectMetadataWithDependencies GetObjectTypeMetadataCopy(ViewModelSerializationMap map) { var key = new ViewModelSerializationMapWithCulture(map, CultureInfo.CurrentUICulture.Name); - var obj = cachedObjectMetadata.GetOrAdd(key, BuildObjectTypeMetadata(map)); + var obj = cachedObjectMetadata.GetOrAdd(key, _ => BuildObjectTypeMetadata(map)); return new ObjectMetadataWithDependencies((JObject)obj.Metadata.DeepClone(), obj.DependentObjectTypes, obj.DependentEnumTypes); }