Skip to content

Commit 1f76eea

Browse files
committed
Check for property first
1 parent b15c6b2 commit 1f76eea

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor

x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/editor.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ export const Editor: React.FC<
257257

258258
const shouldShowGroupByOptimizationWarning = useMemo(() => {
259259
const hasSetGroupBy = alertParams.groupBy && alertParams.groupBy.length > 0;
260-
const hasSetOptimizableThresholdComparator = alertParams.count.comparator === Comparator.GT;
260+
const hasSetOptimizableThresholdComparator =
261+
alertParams.count && alertParams.count.comparator === Comparator.GT;
261262
return hasSetGroupBy && !hasSetOptimizableThresholdComparator;
262263
}, [alertParams]);
263264

0 commit comments

Comments
 (0)