Add fix to prevent iterating past the number of visible back views.

This commit is contained in:
Gregory John Casamento 2021-10-27 15:00:38 -04:00
parent 5666d7b7c2
commit ac5b949f2a
2 changed files with 6 additions and 1 deletions

View file

@ -291,7 +291,7 @@ static NSUInteger draggedItemIndex = NSNotFound;
if (draggingLeft)
{
// dragging to the left of dragged item's current location
for (index=0; index < draggedItemIndex; index++)
for (index=0; index < draggedItemIndex && index < [visibleBackViews count]; index++)
{
itemRect = [[visibleBackViews objectAtIndex:index] frame];
if (location.x < (itemRect.origin.x + (itemRect.size.width/2)))