From 6d2d8fd4eb343e1763f8844fed4eeb154695310f Mon Sep 17 00:00:00 2001 From: Lorenzo Natali Date: Tue, 10 Jan 2017 11:47:50 +0100 Subject: [PATCH] Fix infinite loop when query panel is closed. (#1377) * Fix infinite loop when query panel is closed. * Fix default map --- .../components/data/featuregrid/DockedFeatureGrid.jsx | 6 +++--- web/client/plugins/TOC.jsx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web/client/components/data/featuregrid/DockedFeatureGrid.jsx b/web/client/components/data/featuregrid/DockedFeatureGrid.jsx index f4c6170f49..aa0b16174f 100644 --- a/web/client/components/data/featuregrid/DockedFeatureGrid.jsx +++ b/web/client/components/data/featuregrid/DockedFeatureGrid.jsx @@ -217,13 +217,13 @@ const DockedFeatureGrid = React.createClass({ ); } - let cols = this.props.columnsDef.map((column) => { + let cols = this.props.columnsDef && this.props.columnsDef.map((column) => { if (!column.profiles || (column.profiles && column.profiles.indexOf(this.props.profile) !== -1)) { return assign({}, column, {field: "properties." + column.field}); } }).filter((c) => c); - if (this.sortModel && this.sortModel.length > 0) { + if (cols && this.sortModel && this.sortModel.length > 0) { cols = cols.map((c) => { let model = head(this.sortModel.filter((m) => m.colId === c.field)); if ( model ) { @@ -235,7 +235,7 @@ const DockedFeatureGrid = React.createClass({ let gridConf = this.props.pagination ? {dataSource: this.getDataSource(this.props.dataSourceOptions), features: []} : {features: this.props.features}; - if (this.props.filterObj) { + if (this.props.filterObj && cols) { return ( - + ); },