feat: throws when collection is not initialized.

This commit is contained in:
rabbitism
2025-09-16 20:10:57 +08:00
parent d40c2c5c90
commit 051710affe
2 changed files with 5 additions and 6 deletions

View File

@@ -1587,6 +1587,7 @@ public partial class MultiAutoCompleteBox : TemplatedControl, IInnerContentContr
// Completion will update the selected value
//UpdateTextCompletion(false);
_ = SelectedItems ?? throw new NullReferenceException("Selected Items collection must be initialized. ");
SelectedItems?.Add(_adapter?.SelectedItem);
UpdateTextValue(string.Empty, false);