Skip to content

Commit

Permalink
[NUI] fix svace issue. check Selected item existance.
Browse files Browse the repository at this point in the history
  • Loading branch information
everLEEst committed Mar 17, 2023
1 parent 78d9592 commit 30f3b55
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,17 @@ public partial class RecyclerViewItem : Control
else if (collectionView.SelectionMode is ItemSelectionMode.Multiple)
{
var selectedList = collectionView.SelectedItems;
bool contains = selectedList.Contains(context);
if (newSelected && !contains)
if (selectedList != null)
{
selectedList.Add(context);
}
else if (!newSelected && contains)
{
selectedList.Remove(context);
bool contains = selectedList.Contains(context);
if (newSelected && !contains)
{
selectedList.Add(context);
}
else if (!newSelected && contains)
{
selectedList.Remove(context);
}
}
}
}
Expand Down

0 comments on commit 30f3b55

Please sign in to comment.