diff --git a/src/client/spark_core/Collections/Extensions/DictionaryExtensions.cs b/src/client/spark_core/Collections/Extensions/DictionaryExtensions.cs index b5f68ad6b..4043acd2a 100644 --- a/src/client/spark_core/Collections/Extensions/DictionaryExtensions.cs +++ b/src/client/spark_core/Collections/Extensions/DictionaryExtensions.cs @@ -1,6 +1,7 @@ using bts.collections; using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; using System.Linq; namespace System.Collections.Generic { @@ -114,7 +115,8 @@ namespace System.Collections.Generic { } #nullable enable - public static TValue? GetValueOrDefault(this Dictionary? dictionary, TKey key) where TKey : notnull { + [return:MaybeNull] + public static TValue GetValueOrDefault(this Dictionary? dictionary, TKey key) where TKey : notnull { if (dictionary is null) { throw new ArgumentNullException(nameof(dictionary)); }