From b3ff11b855bd5e15e387bb619a4c15117a3bd3c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 27 Oct 2023 13:59:45 +0100 Subject: [PATCH] this._mouseOverEntry can be null on resizing header/footer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit seen sometimes when debugging moving rows and cols with comments in them Signed-off-by: Caolán McNamara Change-Id: I20a01f27957b5fa507cd37a1020a93bbba05c630 --- browser/src/control/Control.ColumnHeader.ts | 2 +- browser/src/control/Control.RowHeader.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/browser/src/control/Control.ColumnHeader.ts b/browser/src/control/Control.ColumnHeader.ts index 8bd1d50dac0f..cff860a3db03 100644 --- a/browser/src/control/Control.ColumnHeader.ts +++ b/browser/src/control/Control.ColumnHeader.ts @@ -254,7 +254,7 @@ export class ColumnHeader extends Header { const entry = this._mouseOverEntry; let modifier = 0; - if (this._startSelectionEntry && this._startSelectionEntry.index !== entry.index) { + if (this._startSelectionEntry && entry && this._startSelectionEntry.index !== entry.index) { this._selectColumn(this._startSelectionEntry.index, modifier); modifier += UNOModifier.SHIFT; this._selectColumn(entry.index, modifier); diff --git a/browser/src/control/Control.RowHeader.ts b/browser/src/control/Control.RowHeader.ts index 7abf497baa6d..bd24f1ff5f42 100644 --- a/browser/src/control/Control.RowHeader.ts +++ b/browser/src/control/Control.RowHeader.ts @@ -242,7 +242,7 @@ export class RowHeader extends cool.Header { const entry = this._mouseOverEntry; let modifier = 0; - if (this._startSelectionEntry && this._startSelectionEntry.index !== entry.index) { + if (this._startSelectionEntry && entry && this._startSelectionEntry.index !== entry.index) { this._selectRow(this._startSelectionEntry.index, modifier); modifier += UNOModifier.SHIFT; this._selectRow(entry.index, modifier);