Skip to content

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.

Refactor subscriber data src to check for errors

Kailash Nadh9655ce6f1405
diff --git a/frontend/my/src/Subscribers.js b/frontend/my/src/Subscribers.js
index adb12b8c..5b4c9511 100644
--- a/frontend/my/src/Subscribers.js
+++ b/frontend/my/src/Subscribers.js
@@ -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={{