Fix a crash when there's only 1 tile and it gets shrunk

This commit is contained in:
Robin Townsend 2023-02-03 09:11:25 -05:00
parent 42e4f6ce83
commit 6cd939db0c

View file

@ -119,7 +119,7 @@ const findLastIndex = <T,>(
array: T[],
predicate: (item: T) => boolean
): number | null => {
for (let i = array.length - 1; i > 0; i--) {
for (let i = array.length - 1; i >= 0; i--) {
if (predicate(array[i])) return i;
}