handle no fields for a measurement gracefully

pull/3134/head
Brandon Farmer 2018-04-04 17:47:31 -07:00
parent 3ffaa55aee
commit a910089e6a
1 changed files with 6 additions and 1 deletions

View File

@ -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,
})
})
}