Skip to content

Commit 56f5d33

Browse files
committed
Update
1 parent db70522 commit 56f5d33

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/plugins/NodaMoneyTest/CurrencyCode.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
namespace NodaMoneyTest;
55

6+
[System.Diagnostics.CodeAnalysis.SuppressMessage(
7+
"Critical Code Smell",
8+
"S2339:Public constant members should not be used",
9+
Justification = "<Pending>")]
610
public static class CurrencyCode
711
{
812

@@ -30,8 +34,8 @@ public static class CurrencyCode
3034
public const string USD = "USD";
3135

3236
public static readonly FrozenDictionary<string, Currency> SupportedCurrency = typeof(CurrencyCode).GetFields()
33-
.Where(o => o.IsLiteral)
34-
.Select(o => Currency.FromCode((string)o.GetValue(null)!))
37+
.Where(static o => o.IsLiteral)
38+
.Select(static o => Currency.FromCode((string)(o.GetValue(null) ?? throw new InvalidOperationException())))
3539
.ToFrozenDictionary(static o => o.Code, o => o);
3640

3741
#endregion

0 commit comments

Comments
 (0)