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]); }