From 99580515eb8f939e3da37b8dad64cfc0d4b52aaa Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sun, 11 May 2025 22:11:56 -0400 Subject: [PATCH] Enforce notnull on converters --- SabreTools.Core/Tools/Converters.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SabreTools.Core/Tools/Converters.cs b/SabreTools.Core/Tools/Converters.cs index e31b6b89..525a002d 100644 --- a/SabreTools.Core/Tools/Converters.cs +++ b/SabreTools.Core/Tools/Converters.cs @@ -28,7 +28,7 @@ namespace SabreTools.Core.Tools /// String value to parse/param> /// Enum type that is expected /// Enum value representing the input, default on error - public static T? AsEnumValue(this string? value) + public static T? AsEnumValue(this string? value) where T : notnull { // Get the mapping dictionary var mappings = GenerateToEnum(); @@ -51,7 +51,7 @@ namespace SabreTools.Core.Tools /// /// Enum type that is expected /// Dictionary of string to enum values - public static Dictionary GenerateToEnum() + public static Dictionary GenerateToEnum() where T : notnull { try {