mirror of
https://github.com/Microsoft/vscode
synced 2024-09-18 01:58:27 +00:00
Fix _getViewIndexUpperBound throwing if the view model is undefined
Return -1 instead, which the callers check
This commit is contained in:
parent
03b6a2e6b7
commit
25c0fb7f2f
|
@ -534,7 +534,11 @@ export class NotebookCellList extends WorkbenchList<CellViewModel> implements ID
|
||||||
|
|
||||||
|
|
||||||
private _getViewIndexUpperBound(cell: ICellViewModel): number {
|
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) {
|
if (!this.hiddenRangesPrefixSum) {
|
||||||
return modelIndex;
|
return modelIndex;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue