From a9cfb7f61367d5cbb6321c9d60e204dafec61688 Mon Sep 17 00:00:00 2001 From: Peter Foster Date: Wed, 15 Apr 2026 03:06:17 +0100 Subject: [PATCH] Fix NullReferenceException in PriceSliderCard_ValueChanged Slider ValueChanged fires during XAML init before named controls exist. Guard with IsLoaded check, same pattern as UpdateCardTitleBar. Co-Authored-By: Claude Sonnet 4.6 --- EbayListingTool/Views/PhotoAnalysisView.xaml.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/EbayListingTool/Views/PhotoAnalysisView.xaml.cs b/EbayListingTool/Views/PhotoAnalysisView.xaml.cs index 0e6b435..955f756 100644 --- a/EbayListingTool/Views/PhotoAnalysisView.xaml.cs +++ b/EbayListingTool/Views/PhotoAnalysisView.xaml.cs @@ -749,6 +749,7 @@ public partial class PhotoAnalysisView : UserControl private void PriceSliderCard_ValueChanged(object sender, RoutedPropertyChangedEventArgs e) { + if (!IsLoaded) return; var price = (decimal)e.NewValue; SliderVerbalLabel.Text = NumberWords.ToVerbalPrice(price); SliderDigitLabel.Text = $"£{price:F2}";