From 52243d859be457ba26c1fb58a3e33e15a2eaebc6 Mon Sep 17 00:00:00 2001 From: Dimitris Sotirakis Date: Wed, 14 Apr 2021 12:47:30 +0300 Subject: [PATCH] Fix alert frequency check (#32974) --- public/app/features/alerting/AlertTabCtrl.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/app/features/alerting/AlertTabCtrl.ts b/public/app/features/alerting/AlertTabCtrl.ts index 0cd209d1473..4500758209e 100644 --- a/public/app/features/alerting/AlertTabCtrl.ts +++ b/public/app/features/alerting/AlertTabCtrl.ts @@ -266,7 +266,11 @@ export class AlertTabCtrl { checkFrequency() { this.frequencyWarning = ''; - if (!(this.alert.frequency || '').match(/^\d+([dhms])$/)) { + if (!this.alert.frequency) { + return; + } + + if (!this.alert.frequency.match(/^\d+([dhms])$/)) { this.frequencyWarning = 'Invalid frequency, has to be numeric followed by one of the following units: "d, h, m, s"'; return;