From 72d8498fe040ce94bf004771a6a1eaa930106d0e Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Mon, 17 Apr 2023 09:48:01 -0700 Subject: [PATCH] Minor tweaks --- PluginCommon/VisBitmap8.cs | 2 +- SourceGen/AppSettings.cs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/PluginCommon/VisBitmap8.cs b/PluginCommon/VisBitmap8.cs index 491cd4e..fd7716c 100644 --- a/PluginCommon/VisBitmap8.cs +++ b/PluginCommon/VisBitmap8.cs @@ -186,7 +186,7 @@ namespace PluginCommon { /// /// Might want a way to specify that the background shouldn't be drawn at all. /// - /// Bitma to draw on. + /// Bitmap to draw on. /// Character to draw. /// X coord of upper-left pixel. /// Y coord of upper-left pixel. diff --git a/SourceGen/AppSettings.cs b/SourceGen/AppSettings.cs index afe97ef..6daf125 100644 --- a/SourceGen/AppSettings.cs +++ b/SourceGen/AppSettings.cs @@ -315,6 +315,11 @@ namespace SourceGen { /// Setting value (integer enum index). public void SetEnum(string name, Type enumType, int value) { string newVal = Enum.GetName(enumType, value); + if (newVal == null) { + // Shouldn't be possible if an enum value of the correct type is passed in. + Debug.WriteLine("Unable to get enum name type=" + enumType + " value=" + value); + return; + } if (!mSettings.TryGetValue(name, out string oldValue) || oldValue != newVal) { mSettings[name] = newVal; Dirty = true;