diff --git a/src/VariableSizeList.js b/src/VariableSizeList.js index 4bec6b78..24fc0473 100644 --- a/src/VariableSizeList.js +++ b/src/VariableSizeList.js @@ -147,6 +147,7 @@ const getEstimatedTotalSize = ( let totalSizeOfMeasuredItems = 0; if (lastMeasuredIndex >= 0) { + if (lastMeasuredIndex >= itemMetadataMap.length) lastMeasuredIndex = itemMetadataMap.length - 1; const itemMetadata = itemMetadataMap[lastMeasuredIndex]; totalSizeOfMeasuredItems = itemMetadata.offset + itemMetadata.size; }