Refactor subscriber data src to check for errors

This commit is contained in:
Kailash Nadh 2019-03-28 17:16:21 +05:30
parent e43c9b88e9
commit 9655ce6f14
1 changed files with 9 additions and 1 deletions

View File

@ -762,7 +762,15 @@ class Subscribers extends React.PureComponent {
<Table <Table
columns={this.columns} columns={this.columns}
rowKey={record => `sub-${record.id}`} 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} loading={this.props.reqStates[cs.ModelSubscribers] !== cs.StateDone}
pagination={pagination} pagination={pagination}
rowSelection={{ rowSelection={{