Skip to content

Commit

Permalink
fix: make sure rowNode exists before trying to loop on it
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Oct 24, 2023
1 parent 3e261a4 commit 244870d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions slick.grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -3543,6 +3543,10 @@ if (typeof Slick === "undefined") {
});
}
}

if (!cacheEntry.rowNode) {
cacheEntry.rowNode = [];
}
postProcessedCleanupQueue.push({
actionType: 'R',
groupId: postProcessgroupId,
Expand All @@ -3566,7 +3570,7 @@ if (typeof Slick === "undefined") {

function removeRowFromCache(row) {
var cacheEntry = rowsCache[row];
if (!cacheEntry) {
if (!cacheEntry || !cacheEntry.rowNode) {
return;
}

Expand Down Expand Up @@ -5113,7 +5117,7 @@ if (typeof Slick === "undefined") {
if (activeCellNode !== null) {
makeActiveCellNormal();
activeCellNode.classList.remove("active");
if (rowsCache[activeRow]) {
if (rowsCache[activeRow] && rowsCache[activeRow].rowNode) {
rowsCache[activeRow].rowNode.forEach(function (node) {
node.classList.remove("active");
});
Expand Down Expand Up @@ -5146,7 +5150,7 @@ if (typeof Slick === "undefined") {

if (options.showCellSelection) {
activeCellNode.classList.add("active");
if (rowsCache[activeRow]) {
if (rowsCache[activeRow] && rowsCache[activeRow].rowNode) {
rowsCache[activeRow].rowNode.forEach(function (node) {
node.classList.add("active");
});
Expand Down

0 comments on commit 244870d

Please sign in to comment.