From 111292033531a2bc3b8ab58f6c81c169d4ecab85 Mon Sep 17 00:00:00 2001 From: Umberto Pepato Date: Mon, 23 Sep 2024 17:44:26 +0200 Subject: [PATCH] Add fallback value for alert filter controls undefined panels --- .../kbn-alerts-ui-shared/src/alert_filter_controls/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/kbn-alerts-ui-shared/src/alert_filter_controls/utils.ts b/packages/kbn-alerts-ui-shared/src/alert_filter_controls/utils.ts index dc9dff619088f..2d40d3bbf06bb 100644 --- a/packages/kbn-alerts-ui-shared/src/alert_filter_controls/utils.ts +++ b/packages/kbn-alerts-ui-shared/src/alert_filter_controls/utils.ts @@ -17,7 +17,7 @@ import { isEmpty, isEqual, pick } from 'lodash'; import type { FilterControlConfig } from './types'; export const getPanelsInOrderFromControlsState = (controlState: ControlGroupRuntimeState) => { - const panels = controlState.initialChildControlState; + const panels = controlState.initialChildControlState ?? {}; return Object.values(panels).sort((a, b) => a.order - b.order); };