Tig 8 months ago
parent
commit
4ad5b05be8
1 changed files with 6 additions and 4 deletions
  1. 6 4
      Terminal.Gui/Configuration/SettingsScope.cs

+ 6 - 4
Terminal.Gui/Configuration/SettingsScope.cs

@@ -152,10 +152,12 @@ public class SettingsScope : Scope<SettingsScope>
             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);
     }