Skip to content

Commit cf9dcee

Browse files
committed
fix strict-null-check
1 parent d55b443 commit cf9dcee

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/vs/editor/contrib/linesOperations/browser/linesOperations.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,10 @@ abstract class AbstractMoveLinesAction extends EditorAction {
215215
for (const selection of selections) {
216216
if (movingMultipleLines) {
217217
// If we are at the beginning/end of document and multiple lines are moved, abort.
218-
if ((selection.startLineNumber === 1 && !this.down) || (selection.endLineNumber === editor.getModel()?.getLineCount() && this.down)) {
218+
let model = editor.getModel();
219+
let lineCount = model !== null ? model.getLineCount() : 0;
220+
221+
if ((selection.startLineNumber === 1 && !this.down) || (selection.endLineNumber === lineCount && this.down)) {
219222
editor.pushUndoStop();
220223
return;
221224
}

0 commit comments

Comments
 (0)