From 20912c12e7aa921fbafd8214b8b70ba08f002f77 Mon Sep 17 00:00:00 2001 From: Craig Citro Date: Sat, 26 Jun 2021 18:42:09 -0500 Subject: [PATCH] Check for jpg bytes before make_response If jpg_bytes wasn't retrieved from either desk or a tracked object, respond with 404 Prevents uncaught error for unknown event ids sent to event_snapshot endpoint --- frigate/http.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frigate/http.py b/frigate/http.py index 75e00b26c..b39596e9d 100644 --- a/frigate/http.py +++ b/frigate/http.py @@ -214,6 +214,9 @@ def event_snapshot(id): except: return "Event not found", 404 + if jpg_bytes is None: + return "Event not found", 404 + response = make_response(jpg_bytes) response.headers["Content-Type"] = "image/jpg" return response