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); }