From 9cffc2a284445c7ce7712a60339d2558b9ee63ff Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Sat, 18 Jul 2026 18:03:35 -0600 Subject: [PATCH] Handle case where default field is deleted even though there is no backing YAML --- frigate/util/builtin.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frigate/util/builtin.py b/frigate/util/builtin.py index 35dba2f3a7..bb93587cea 100644 --- a/frigate/util/builtin.py +++ b/frigate/util/builtin.py @@ -333,9 +333,11 @@ def update_yaml(data, key_path, new_value): last_key = key_path[-1] if new_value == "": if isinstance(last_key, tuple): - del temp[last_key[0]][last_key[1]] - clear_orphaned_comments(temp[last_key[0]], temp, last_key[0]) - else: + sequence = temp.get(last_key[0]) + if sequence is not None and last_key[1] < len(sequence): + del sequence[last_key[1]] + clear_orphaned_comments(sequence, temp, last_key[0]) + elif last_key in temp: del temp[last_key] clear_orphaned_comments(temp, parent, parent_key) else: