diff --git a/x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/editor.tsx b/x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/editor.tsx index e88099805c9970..80fd1600fa0b30 100644 --- a/x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/editor.tsx +++ b/x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/editor.tsx @@ -257,7 +257,8 @@ export const Editor: React.FC< const shouldShowGroupByOptimizationWarning = useMemo(() => { const hasSetGroupBy = alertParams.groupBy && alertParams.groupBy.length > 0; - const hasSetOptimizableThresholdComparator = alertParams.count.comparator === Comparator.GT; + const hasSetOptimizableThresholdComparator = + alertParams.count && alertParams.count.comparator === Comparator.GT; return hasSetGroupBy && !hasSetOptimizableThresholdComparator; }, [alertParams]);