check if preset exists in getpreset

This commit is contained in:
bluepilledgreat 2024-11-29 15:30:40 +00:00
parent a21d820af1
commit 5294612d03

View File

@ -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<T>(IReadOnlyDictionary<T, string> mapping, string prefix, string value) where T : Enum
{