Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Properly handle a null row / zero rows
Browse files Browse the repository at this point in the history
Fixes #5236

Auditors: @darkdh

Test Plan:
1. Launch Brave and go to Preferences
2. Go to Search and confirm it loads
3. Go to Payments and confirm it loads
  • Loading branch information
bsclifton committed Oct 28, 2016
1 parent 09e858c commit e882655
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/components/sortableTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,14 +363,15 @@ class SortableTable extends React.Component {
? this.getRowAttributes(row, i)
: null

const classes = [rowAttributes.className]
const classes = []
if (rowAttributes) classes.push(rowAttributes.className)
if (this.hasRowClassNames) classes.push(this.props.rowClassNames[i])
if (this.stateOwner.state.selection.includes(this.getGlobalIndex(i))) classes.push('selected')
if (this.sortingDisabled) classes.push('no-sort')

return row.length
? <tr {...rowAttributes}
data-context-menu-disable={rowAttributes.onContextMenu ? true : undefined}
data-context-menu-disable={rowAttributes && rowAttributes.onContextMenu ? true : undefined}
data-table-id={this.tableID}
data-row-index={i}
className={classes.join(' ')}>{entry}</tr>
Expand Down

0 comments on commit e882655

Please sign in to comment.