From 4c30f1e4673d0ed5d498ce5361be457699220e89 Mon Sep 17 00:00:00 2001 From: ryzendigo Date: Tue, 17 Mar 2026 06:56:21 +0800 Subject: [PATCH] fix: initialize result variable in generate_description_embedding The result variable is only assigned inside the semantic_search.enabled and len(new_description) > 0 conditions. If either is false, the return statement references an undefined variable, raising UnboundLocalError. Initialize result = None before the conditional block. --- frigate/api/event.py | 1 + 1 file changed, 1 insertion(+) diff --git a/frigate/api/event.py b/frigate/api/event.py index 567fe5a4b..26e8e04ed 100644 --- a/frigate/api/event.py +++ b/frigate/api/event.py @@ -1639,6 +1639,7 @@ def generate_description_embedding( body: EventsDescriptionBody, ): new_description = body.description + result = None # If semantic search is enabled, update the index if request.app.frigate_config.semantic_search.enabled: