From f28103173bf2a2885711c5686c4f6f985d98a31d Mon Sep 17 00:00:00 2001 From: f0o Date: Thu, 27 Aug 2015 14:05:47 +0100 Subject: [PATCH] Only process followups if there are any results --- alerts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alerts.php b/alerts.php index fafc909ac1..7a0f7afd40 100755 --- a/alerts.php +++ b/alerts.php @@ -193,7 +193,7 @@ function RunFollowUp() { $state = 4; } - if ($state > 0) { + if ($state > 0 && $n > 0) { $alert['details']['rule'] = $chk; if (dbInsert(array('state' => $state, 'device_id' => $alert['device_id'], 'rule_id' => $alert['rule_id'], 'details' => gzcompress(json_encode($alert['details']), 9)), 'alert_log')) { dbUpdate(array('state' => $state, 'open' => 1, 'alerted' => 1), 'alerts', 'rule_id = ? && device_id = ?', array($alert['rule_id'], $alert['device_id']));