From 5294612d0318b57149e425a7bd5f5118d1a3537c Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Fri, 29 Nov 2024 15:30:40 +0000 Subject: [PATCH] check if preset exists in getpreset --- Bloxstrap/FastFlagManager.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Bloxstrap/FastFlagManager.cs b/Bloxstrap/FastFlagManager.cs index 689299e..a69b3e5 100644 --- a/Bloxstrap/FastFlagManager.cs +++ b/Bloxstrap/FastFlagManager.cs @@ -207,7 +207,17 @@ namespace Bloxstrap } } - public string? GetPreset(string name) => GetValue(PresetFlags[name]); + public string? GetPreset(string name) + { + if (!PresetFlags.ContainsKey(name)) + { + App.Logger.WriteLine("FastFlagManager::GetPreset", $"Could not find preset {name}"); + Debug.Assert(false, $"Could not find preset {name}"); + return null; + } + + return GetValue(PresetFlags[name]); + } public T GetPresetEnum(IReadOnlyDictionary mapping, string prefix, string value) where T : Enum {