From b9e191eeb95ed64bf647d23c0b6ade0d0fee822d Mon Sep 17 00:00:00 2001 From: John Colvin Date: Tue, 9 Sep 2025 13:47:27 -0400 Subject: [PATCH] refactor: Drop nullable modifier for TValue in GetValueOrDefault ext fn --- .../spark_core/Collections/Extensions/DictionaryExtensions.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)); }