Fixed a rare crash if still subscribed to items PropertyChanged event and it gets triggered

This commit is contained in:
COM8 2018-10-19 16:59:37 +02:00
Родитель e7bc38fef6
Коммит ca84f1bf98
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -469,6 +469,12 @@ namespace Microsoft.Toolkit.Uwp.UI
{
var oldIndex = _view.IndexOf(item);
// Check if item is in view:
if (oldIndex < 0)
{
return;
}
_view.RemoveAt(oldIndex);
var targetIndex = _view.BinarySearch(item, this);
if (targetIndex < 0)