From f36ba01460c568ffa73c03354b9dd7334eb3ee7a Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Thu, 5 Oct 2017 11:15:46 -0700 Subject: [PATCH] Add a null check to areSelectionValuesReversed See Microsoft/vscode#35601 --- src/SelectionModel.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/SelectionModel.ts b/src/SelectionModel.ts index 1fbf40fe..5982b1e9 100644 --- a/src/SelectionModel.ts +++ b/src/SelectionModel.ts @@ -97,6 +97,9 @@ export class SelectionModel { public areSelectionValuesReversed(): boolean { const start = this.selectionStart; const end = this.selectionEnd; + if (!start || !end) { + return false; + } return start[1] > end[1] || (start[1] === end[1] && start[0] > end[0]); }