Skip to content

Commit

Permalink
fix: check for row existence in handleRowById (#3422)
Browse files Browse the repository at this point in the history
Co-authored-by: Joseph Schenck <joseph@josephschenck.com>
  • Loading branch information
jschen2 and Joseph Schenck committed Apr 8, 2022
1 parent f2e8827 commit 36bb614
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/plugin-hooks/useRowSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,18 @@ function reducer(state, action, previousState, instance) {
const handleRowById = id => {
const row = rowsById[id]

if (!row.isGrouped) {
if (shouldExist) {
newSelectedRowIds[id] = true
} else {
delete newSelectedRowIds[id]
if (row) {
if (!row.isGrouped) {
if (shouldExist) {
newSelectedRowIds[id] = true
} else {
delete newSelectedRowIds[id]
}
}
}

if (selectSubRows && getSubRows(row)) {
return getSubRows(row).forEach(row => handleRowById(row.id))
if (selectSubRows && getSubRows(row)) {
return getSubRows(row).forEach(row => handleRowById(row.id))
}
}
}

Expand Down

0 comments on commit 36bb614

Please sign in to comment.