Skip to content

Commit 4ef172d

Browse files
authored
fix: try adding sort icon on non sortable column shouldn't throw (#930)
1 parent d39e827 commit 4ef172d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

slick.grid.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3002,11 +3002,14 @@ if (typeof Slick === "undefined") {
30023002
if (column) {
30033003
column.classList.add("slick-header-column-sorted");
30043004
let indicator = column.querySelector(".slick-sort-indicator");
3005-
indicator.classList.add(col.sortAsc ? "slick-sort-indicator-asc" : "slick-sort-indicator-desc");
3006-
3005+
if (indicator) {
3006+
indicator.classList.add(col.sortAsc ? "slick-sort-indicator-asc" : "slick-sort-indicator-desc");
3007+
}
30073008
if (numberCols) {
30083009
indicator = column.querySelector(".slick-sort-indicator-numbered");
3009-
indicator.textContent = i;
3010+
if (indicator) {
3011+
indicator.textContent = i;
3012+
}
30103013
}
30113014
}
30123015
}

0 commit comments

Comments
 (0)