diff --git a/src/client/spark_core/Collections/Extensions/DictionaryExtensions.cs b/src/client/spark_core/Collections/Extensions/DictionaryExtensions.cs index 7598bdc20..67fdb2903 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 { @@ -122,7 +123,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)); }