From 9f404f7b9708a5e962c2c3e8597f462f5f7344f5 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sat, 26 Mar 2022 12:47:26 -0400 Subject: [PATCH] Add test for event before calling event->Duration. --- src/zm_monitor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index eb4eb3395..704df6639 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -2028,7 +2028,7 @@ bool Monitor::Analyse() { Info("%s: %03d - Gone into alert state", name.c_str(), analysis_image_count); shared_data->state = state = ALERT; } else if (state == ALERT) { - if ( + if ( event && ((analysis_image_count - last_alarm_count) > post_event_count) && (event->Duration() >= min_section_length)) {