From 4ad5b05be832855a5b152ae43a9b1847aeb3cd6e Mon Sep 17 00:00:00 2001 From: Tig Date: Sat, 23 Nov 2024 15:40:31 -0700 Subject: [PATCH] CM bugs --- Terminal.Gui/Configuration/SettingsScope.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Terminal.Gui/Configuration/SettingsScope.cs b/Terminal.Gui/Configuration/SettingsScope.cs index ab51ff8af..25936ca86 100644 --- a/Terminal.Gui/Configuration/SettingsScope.cs +++ b/Terminal.Gui/Configuration/SettingsScope.cs @@ -152,10 +152,12 @@ public class SettingsScope : Scope return this; } - // BUG: Not trim-compatible - // Not a bug, per se, but it's easily fixable by just loading the file. - // Defaults can just be field initializers for involved types. - using Stream? stream = assembly.GetManifestResourceStream (resourceName)!; + using Stream? stream = assembly.GetManifestResourceStream (resourceName); + + if (stream is null) + { + return null; + } return Update (stream, $"resource://[{assembly.GetName ().Name}]/{resourceName}", location); }