Guard against no field in buildDefaultYLabel

pull/10616/head
Andrew Watkins 2017-09-27 16:05:23 -07:00
parent 56dcc31d82
commit f545f9cddd
1 changed files with 5 additions and 1 deletions

View File

@ -112,5 +112,9 @@ function getRolesForUser(roles, user) {
export const buildDefaultYLabel = queryConfig => {
return queryConfig.rawText
? ''
: `${queryConfig.measurement}.${queryConfig.fields[0].field}`
: `${queryConfig.measurement}.${_.get(
queryConfig,
['fields', '0', 'field'],
''
)}`
}