Fix a crash when there's only 1 tile and it gets shrunk
This commit is contained in:
1 parent
42e4f6ce83
commit
6cd939db0c
1 file changed
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user