From 17ed25e101aef762191eb2bce274da5635f2fca9 Mon Sep 17 00:00:00 2001 From: jackyin Date: Mon, 6 Jan 2025 22:39:31 +0800 Subject: [PATCH] Alerting: Fix alert rule list view summaries (#98433) --- .../alerting/unified/hooks/useCombinedRuleNamespaces.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/app/features/alerting/unified/hooks/useCombinedRuleNamespaces.ts b/public/app/features/alerting/unified/hooks/useCombinedRuleNamespaces.ts index 316bb99fa28..1b8043691d9 100644 --- a/public/app/features/alerting/unified/hooks/useCombinedRuleNamespaces.ts +++ b/public/app/features/alerting/unified/hooks/useCombinedRuleNamespaces.ts @@ -368,7 +368,9 @@ function calculateAllGroupsTotals(groups: CombinedRuleGroup[]): AlertGroupTotals totals[key] = 0; } - totals[key] += value; + if (value !== undefined && value !== null) { + totals[key] += value; + } }); });