Skip to content

Commit

Permalink
Merge pull request #301 from AvaloniaUI/fixes/nre-treeselecteditems
Browse files Browse the repository at this point in the history
Check for null ItemsView in TreeSelectedItems.
  • Loading branch information
grokys authored Jul 3, 2024
2 parents a0da097 + 7ff0fe3 commit d5d6496
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ public T? this[int index]
{
for (var i = range.Begin; i <= range.End; ++i)
{
yield return node.ItemsView![i];
if (node.ItemsView is not null)
yield return node.ItemsView[i];
}
}

Expand Down Expand Up @@ -110,4 +111,4 @@ public TreeSelectedItems(TreeSelectionModelBase<T> root) : base(root) { }
yield return i;
}
}
}
}

0 comments on commit d5d6496

Please sign in to comment.