Fix a crash when there's only 1 tile and it gets shrunk
This commit is contained in:
@@ -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