[hotfix] dashboard won't load, error in fields.js

This commit is contained in:
Maxime Beauchemin
2017-02-17 07:13:08 +00:00
parent 5bb87138e9
commit fe377e8b94

View File

@@ -65,7 +65,7 @@ export const fields = {
multi: true,
label: 'Metrics',
validators: [v.nonEmpty],
default: field => field.choices !== null ? [field.choices[0][0]] : null,
default: field => field.choices && field.choices.length > 0 ? [field.choices[0][0]] : null,
mapStateToProps: (state) => ({
choices: (state.datasource) ? state.datasource.metrics_combo : [],
}),