Provide better exception for bad INotifyCollectionChanged index bounds (#948)
This commit is contained in:
Родитель
ec5492cd0d
Коммит
6f5d6ce8da
|
@ -500,6 +500,11 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
|
||||
var groupReset = resetWhenGrouped && Element.IsGroupingEnabled;
|
||||
|
||||
var lastIndex = Control.NumberOfRowsInSection(section);
|
||||
if (e.NewStartingIndex > lastIndex || e.OldStartingIndex > lastIndex)
|
||||
throw new ArgumentException(
|
||||
$"Index '{Math.Max(e.NewStartingIndex, e.OldStartingIndex)}' is greater than the number of rows '{lastIndex}'.");
|
||||
|
||||
switch (e.Action)
|
||||
{
|
||||
case NotifyCollectionChangedAction.Add:
|
||||
|
|
Загрузка…
Ссылка в новой задаче