Skip to content

Commit

Permalink
fix(core): add extra checks for some objects to be a bit more strict (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding authored Feb 23, 2024
1 parent 2a2c210 commit 8b95c50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions packages/common/src/core/slickGrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1584,7 +1584,9 @@ export class SlickGrid<TData = any, C extends Column<TData> = Column<TData>, 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;
Expand Down Expand Up @@ -2892,7 +2894,7 @@ export class SlickGrid<TData = any, C extends Column<TData> = Column<TData>, 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;
}
Expand Down Expand Up @@ -3999,7 +4001,7 @@ export class SlickGrid<TData = any, C extends Column<TData> = Column<TData>, 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;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/services/extension.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>;
}

/**
Expand Down

0 comments on commit 8b95c50

Please sign in to comment.