From adda399177da7cb4474ef1e143a3de5e4da59767 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Mon, 27 Jan 2020 17:57:43 -0500 Subject: [PATCH] fix functional test, handle case where fields are not loaded --- x-pack/legacy/plugins/maps/public/components/metric_editor.js | 4 ++++ 1 file changed, 4 insertions(+) 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;