Fix _getViewIndexUpperBound throwing if the view model is undefined

Return -1 instead, which the callers check
This commit is contained in:
Matt Bierner 2021-02-18 15:36:07 -08:00
parent 03b6a2e6b7
commit 25c0fb7f2f

View file

@ -534,7 +534,11 @@ export class NotebookCellList extends WorkbenchList<CellViewModel> implements ID
private _getViewIndexUpperBound(cell: ICellViewModel): number {
const modelIndex = this._viewModel!.getCellIndex(cell);
if (!this._viewModel) {
return -1;
}
const modelIndex = this._viewModel.getCellIndex(cell);
if (!this.hiddenRangesPrefixSum) {
return modelIndex;
}