From a910089e6a67d6c9d2aced0aad5b9a39f17e3b57 Mon Sep 17 00:00:00 2001 From: Brandon Farmer Date: Wed, 4 Apr 2018 17:47:31 -0700 Subject: [PATCH] handle no fields for a measurement gracefully --- ui/src/shared/components/FieldList.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/src/shared/components/FieldList.js b/ui/src/shared/components/FieldList.js index 9c8015dc0..b68494217 100644 --- a/ui/src/shared/components/FieldList.js +++ b/ui/src/shared/components/FieldList.js @@ -125,8 +125,13 @@ class FieldList extends Component { console.error('Error parsing fields keys: ', errors) } + const newFields = _.get(fieldSets, measurement, []).map(f => ({ + value: f, + type: 'field', + })) + this.setState({ - fields: fieldSets[measurement].map(f => ({value: f, type: 'field'})), + fields: newFields, }) }) }