Skip to content

Commit

Permalink
Fix cyclic dependency making the table widhget crash the app. #4209
Browse files Browse the repository at this point in the history
- Check if sanitizedTableData is array
  • Loading branch information
Satish Gandham committed Apr 29, 2021
1 parent 9884135 commit 9fa2fcd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/client/src/widgets/TableWidget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ class TableWidget extends BaseWidget<TableWidgetProps, WidgetState> {
// When we have tableData, the primaryColumns order is unlikely to change
// When we don't have tableData primaryColumns will not be available, so let's let it be.

if (sanitizedTableData.length > 0) {
if (Array.isArray(sanitizedTableData) && sanitizedTableData.length > 0) {
newPrimaryColumns = this.createTablePrimaryColumns();
if (newPrimaryColumns) this.updateColumnProperties(newPrimaryColumns);
}
Expand Down

0 comments on commit 9fa2fcd

Please sign in to comment.