From e882655ec8a8cb7a6c3d62b926e1364235f108cd Mon Sep 17 00:00:00 2001 From: Brian Clifton Date: Fri, 28 Oct 2016 14:23:26 -0700 Subject: [PATCH] Properly handle a null row / zero rows Fixes https://github.com/brave/browser-laptop/issues/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 --- js/components/sortableTable.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/components/sortableTable.js b/js/components/sortableTable.js index f19260e8901..58a546620e6 100644 --- a/js/components/sortableTable.js +++ b/js/components/sortableTable.js @@ -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 ? {entry}