From b67eab42ea887941e99b37a5890620e06f191f70 Mon Sep 17 00:00:00 2001 From: Eideren Date: Fri, 7 Jun 2024 21:47:29 +0200 Subject: [PATCH] Rollback one of the TryAdd introduced through #2299, VS Package is still on net472 (#2315) --- sources/core/Stride.Core.Yaml/Schemas/SchemaBase.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/core/Stride.Core.Yaml/Schemas/SchemaBase.cs b/sources/core/Stride.Core.Yaml/Schemas/SchemaBase.cs index 1d65accbde..590905edfe 100644 --- a/sources/core/Stride.Core.Yaml/Schemas/SchemaBase.cs +++ b/sources/core/Stride.Core.Yaml/Schemas/SchemaBase.cs @@ -347,7 +347,9 @@ protected void RegisterDefaultTagMapping(string tag, Type type, bool isDefault) if (type == null) throw new ArgumentNullException("type"); - mapTypeToShortTag.TryAdd(type, tag); + if (!mapTypeToShortTag.ContainsKey(type)) + mapTypeToShortTag.Add(type, tag); + if (isDefault) { mapShortTagToType[tag] = type;