From 3965f8821d718f3ef239769bd20e1b849209fd95 Mon Sep 17 00:00:00 2001 From: ghiscoding Date: Thu, 22 Feb 2024 23:50:19 -0500 Subject: [PATCH] fix(core): add extra checks for some objects to be a bit more strict --- packages/common/src/core/slickGrid.ts | 8 +++++--- packages/common/src/services/extension.service.ts | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/common/src/core/slickGrid.ts b/packages/common/src/core/slickGrid.ts index 4a6f651fa..284972fbe 100644 --- a/packages/common/src/core/slickGrid.ts +++ b/packages/common/src/core/slickGrid.ts @@ -1584,7 +1584,9 @@ export class SlickGrid = Column, O e for (let i = 0; i < this.columns.length; i++) { const m: C = this.columns[i]; - if (m.hidden) { continue; } + if (!m || m.hidden) { + continue; + } const headerTarget = this.hasFrozenColumns() ? ((i <= this._options.frozenColumn!) ? this._headerL : this._headerR) : this._headerL; const headerRowTarget = this.hasFrozenColumns() ? ((i <= this._options.frozenColumn!) ? this._headerRowL : this._headerRowR) : this._headerRowL; @@ -2892,7 +2894,7 @@ export class SlickGrid = Column, O e protected updateColumnProps() { this.columnsById = {}; for (let i = 0; i < this.columns.length; i++) { - let m: C = this.columns[i]; + let m: C = this.columns[i] || {}; if (m.width) { m.widthRequest = m.width; } @@ -3999,7 +4001,7 @@ export class SlickGrid = Column, O e } // Ignore alwaysRenderedColumns - if (Array.isArray(this.columns) && this.columns[i] && this.columns[i].alwaysRenderColumn) { + if (Array.isArray(this.columns) && this.columns[i]?.alwaysRenderColumn) { return; } diff --git a/packages/common/src/services/extension.service.ts b/packages/common/src/services/extension.service.ts index 63c7d01bc..4c1a76ab2 100644 --- a/packages/common/src/services/extension.service.ts +++ b/packages/common/src/services/extension.service.ts @@ -102,7 +102,7 @@ export class ExtensionService { this._rowMoveManagerPlugin = null as any; this._rowSelectionModel = null as any; this._extensionCreatedList = null as any; - this._extensionList = null as any; + this._extensionList = {} as ExtensionList; } /**