handle last_alert_time or last_detection_time being None when checking them against the frame_time

This commit is contained in:
nulledy 2026-02-09 16:00:16 +00:00
parent 231edb8811
commit 9d0db214a0

View File

@ -394,7 +394,10 @@ class ReviewSegmentMaintainer(threading.Thread):
if activity.has_activity_category(SeverityEnum.alert):
# update current time for last alert activity
if frame_time > segment.last_alert_time:
if (
segment.last_alert_time is None
or frame_time > segment.last_alert_time
):
segment.last_alert_time = frame_time
if segment.severity != SeverityEnum.alert:
@ -405,7 +408,10 @@ class ReviewSegmentMaintainer(threading.Thread):
should_update_image = True
if activity.has_activity_category(SeverityEnum.detection):
if frame_time > segment.last_detection_time:
if (
segment.last_detection_time is None
or frame_time > segment.last_detection_time
):
segment.last_detection_time = frame_time
for object in activity.get_all_objects():