From f6328c63625700fb1a6cf3c2b7e004a54799463a Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Mon, 21 Oct 2024 08:22:32 -0600 Subject: [PATCH] Catch division by zero --- frigate/util/services.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frigate/util/services.py b/frigate/util/services.py index 784a802b4..3f8ecf32c 100644 --- a/frigate/util/services.py +++ b/frigate/util/services.py @@ -282,7 +282,7 @@ def get_intel_gpu_stats() -> dict[str, str]: try: data = json.loads(f'[{"".join(p.stdout.split())}]') except json.JSONDecodeError: - return None + return {"gpu": "-%", "mem": "-%"} results: dict[str, str] = {} render = {"global": []} @@ -332,7 +332,7 @@ def get_intel_gpu_stats() -> dict[str, str]: results["clients"] = {} for key in render.keys(): - if key == "global": + if key == "global" or not render[key] or not video[key]: continue results["clients"][key] = (