diff --git a/src/AcDream.Launcher/MainWindow.axaml.cs b/src/AcDream.Launcher/MainWindow.axaml.cs index cf39085d..90f6c3be 100644 --- a/src/AcDream.Launcher/MainWindow.axaml.cs +++ b/src/AcDream.Launcher/MainWindow.axaml.cs @@ -18,7 +18,13 @@ public sealed partial class MainWindow : Window public MainWindow() { - AvaloniaXamlLoader.Load(this); + // InitializeComponent(), not AvaloniaXamlLoader.Load(this): only the + // generated method assigns the x:Name backing fields. Loading the XAML + // directly leaves every named control (ProfilesTree, the editor text + // boxes, FirstRunDatDirectoryTextBox, UpdateCloseButton, ...) null, so + // the first modal open or close threw NullReferenceException out of the + // dispatcher and took the whole process down through Program's guard. + InitializeComponent(); _statusTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(250),