diff --git a/x-pack/legacy/plugins/maps/public/components/metric_editor.js b/x-pack/legacy/plugins/maps/public/components/metric_editor.js index fc66ecc3b36f2..e60c2ac0dd7ab 100644 --- a/x-pack/legacy/plugins/maps/public/components/metric_editor.js +++ b/x-pack/legacy/plugins/maps/public/components/metric_editor.js @@ -15,6 +15,10 @@ import { SingleFieldSelect } from './single_field_select'; import { METRIC_TYPE } from '../../common/constants'; function filterFieldsForAgg(fields, aggType) { + if (!fields) { + return []; + } + if (aggType === METRIC_TYPE.UNIQUE_COUNT) { return fields.filter(field => { return field.aggregatable;