Skip to content

Commit

Permalink
Refactor subscriber data src to check for errors
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Mar 28, 2019
1 parent e43c9b8 commit 9655ce6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion frontend/my/src/Subscribers.js
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,15 @@ class Subscribers extends React.PureComponent {
<Table
columns={this.columns}
rowKey={record => `sub-${record.id}`}
dataSource={this.props.data[cs.ModelSubscribers].results}
dataSource={(() => {
if (
!this.props.data[cs.ModelSubscribers] ||
!this.props.data[cs.ModelSubscribers].hasOwnProperty("results")
) {
return []
}
return this.props.data[cs.ModelSubscribers].results
})()}
loading={this.props.reqStates[cs.ModelSubscribers] !== cs.StateDone}
pagination={pagination}
rowSelection={{
Expand Down

0 comments on commit 9655ce6

Please sign in to comment.