mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
fix(virtual-scroll): don't crash with an empty cell list (#17799)
This commit is contained in:

committed by
Brandy Carney

parent
8d2a47e881
commit
20c146e1e5
@ -181,7 +181,7 @@ export function getShouldUpdate(dirtyIndex: number, currentRange: Range, range:
|
||||
}
|
||||
|
||||
export function findCellIndex(cells: Cell[], index: number): number {
|
||||
const max = cells[cells.length - 1].index || 0;
|
||||
const max = cells.length > 0 ? cells[cells.length - 1].index : 0;
|
||||
if (index === 0) {
|
||||
return 0;
|
||||
} else if (index === max + 1) {
|
||||
|
Reference in New Issue
Block a user