Skip to content
Open
3 changes: 2 additions & 1 deletion src/vs/base/browser/ui/list/listView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1765,7 +1765,8 @@ export class ListView<T> implements IListView<T> {
const diffs = new Array<number>(range.end - range.start).fill(0);
const measurements: IDynamicHeightMeasurement<T>[] = [];

for (let index = range.start; index < range.end; index++) {
// Re-check `this.items.length` each iteration so a reentrant splice that shrinks the model mid-loop cannot read out of bounds.
for (let index = range.start; index < range.end && index < this.items.length; index++) {
Comment thread
vs-code-engineering[bot] marked this conversation as resolved.
const item = this.items[index];
const delegateHeightDiff = this.probeDynamicHeightFromDelegate(item);
if (delegateHeightDiff !== undefined) {
Expand Down
Loading