From 33c7b50beb0ec895e94a625b6797315df22859e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=BE=E5=90=AF=E5=B7=A5=E4=BD=9C=E5=AE=A4?= Date: Sun, 28 Jun 2026 11:25:16 +0800 Subject: [PATCH] fix: ShowPage null reference when RadioButton.checked fires during XAML load --- Manager/MainWindow.xaml.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Manager/MainWindow.xaml.cs b/Manager/MainWindow.xaml.cs index 841347e..0386e08 100644 --- a/Manager/MainWindow.xaml.cs +++ b/Manager/MainWindow.xaml.cs @@ -39,7 +39,10 @@ namespace BetterSeewo.Manager private void ShowPage(StackPanel page) { foreach (var p in new[] { PageInstall, PageInk, PageConvert, PageTouch, PageActivate }) - p.Visibility = p == page ? Visibility.Visible : Visibility.Collapsed; + { + if (p != null) + p.Visibility = p == page ? Visibility.Visible : Visibility.Collapsed; + } } private void Minimize_Click(object s, RoutedEventArgs e) => WindowState = WindowState.Minimized;