From d42dcc6b043413f08b94fe224f7f5c4fd85d5cea Mon Sep 17 00:00:00 2001 From: Mgg Sk Date: Sat, 19 Jul 2025 16:18:06 +0200 Subject: [PATCH] Fix a null reference exception in UIConfig.cs --- Settings/UiConfig.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Settings/UiConfig.cs b/Settings/UiConfig.cs index e4294ea..e43300f 100644 --- a/Settings/UiConfig.cs +++ b/Settings/UiConfig.cs @@ -112,10 +112,6 @@ public void Save() JsonSerializerOptions options = new(); options.WriteIndented = true; File.WriteAllText(_settingsFile, JsonSerializer.Serialize(Settings, options)); - /* FIXME: For some reason unknown to me, App.MainWindow is null here, but only if the Settings were generated before e.g. on first launch - * No biggy in that case as nothing has been customized yet, but depending on the reason this might cause problems. - */ - App.MainWindow.LoadSettings(); } catch (Exception ex) { @@ -135,6 +131,7 @@ public void Set(string setting, object value) property.SetValue(Settings, Convert.ChangeType(value, property.PropertyType)); Save(); + App.MainWindow.LoadSettings(); } } \ No newline at end of file