diff --git a/src/client/spark/view/Controls/ComboCheckBox/ComboCheckBox.xaml.cs b/src/client/spark/view/Controls/ComboCheckBox/ComboCheckBox.xaml.cs index 624db6591..05c21f446 100644 --- a/src/client/spark/view/Controls/ComboCheckBox/ComboCheckBox.xaml.cs +++ b/src/client/spark/view/Controls/ComboCheckBox/ComboCheckBox.xaml.cs @@ -143,7 +143,15 @@ namespace mbts.ui.controls { case NotifyCollectionChangedAction.Replace: if (e.OldItems != null) foreach (var item in e.OldItems) _set_is_selected(item, false); if (e.NewItems != null) foreach (var item in e.NewItems) _set_is_selected(item, true); break; - case NotifyCollectionChangedAction.Reset: foreach (var item in ItemsSource) _set_is_selected(item, false); break; + case NotifyCollectionChangedAction.Reset: { + var itemsSource = ItemsSource; + if (itemsSource is not null) { + foreach (var item in itemsSource) { + _set_is_selected(item, false); + } + } + } + break; } _update_is_all_selected(); }