diff --git a/App/SicUI/MainViewModel.cs b/App/SicUI/MainViewModel.cs index 46c1402..2e318b5 100644 --- a/App/SicUI/MainViewModel.cs +++ b/App/SicUI/MainViewModel.cs @@ -1075,6 +1075,7 @@ namespace SicUI.Client { var scPath = $"PM.{_currentMenuItem.System}.BackgroundColor"; var scConfig = QueryDataClient.Instance.Service.GetConfig(scPath); + if (scConfig == null) return; var hexColor = scConfig.ToString(); try { @@ -1094,7 +1095,6 @@ namespace SicUI.Client UpdatePMPageBackground(Colors.Transparent); UpdateMainMenuBackground(); } - } else { @@ -1374,12 +1374,12 @@ namespace SicUI.Client if (menuInfo.System is "PM1" or "PM2") { var rect = FindVisualChildByName(container, "InnerBG"); - rect.Fill = menuInfo.Selected + rect?.Fill = menuInfo.Selected ? BgActiveContent : new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF346294")); var bgBorder = FindVisualChildByName(container, "BG"); - bgBorder.Background = menuInfo.Selected + bgBorder?.Background = menuInfo.Selected ? BgActiveContent : new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF346294"));