Skip to content

Commit 094d760

Browse files
authored
fix: tweak setupColumnSort() to fix exception when col no longer exists (#1477)
1 parent 97da209 commit 094d760

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/common/src/core/slickGrid.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1784,8 +1784,9 @@ export class SlickGrid<TData = any, C extends Column<TData> = Column<TData>, O e
17841784
multiColumnSort: true,
17851785
previousSortColumns,
17861786
sortCols: this.sortColumns.map((col) => {
1787-
return { columnId: this.columns[this.getColumnIndex(col.columnId)].id, sortCol: this.columns[this.getColumnIndex(col.columnId)], sortAsc: col.sortAsc };
1788-
})
1787+
const tempCol = this.columns[this.getColumnIndex(col.columnId)];
1788+
return !tempCol ? null : { columnId: tempCol.id, sortCol: tempCol, sortAsc: col.sortAsc };
1789+
}).filter((el) => el)
17891790
};
17901791
}
17911792

0 commit comments

Comments
 (0)