Correctly catch JSONDecodeError

This commit is contained in:
Nicolas Mowen
2025-12-23 06:57:12 -07:00
parent ec6fd2289c
commit aaec0f6e92

View File

@@ -42,11 +42,10 @@ def get_latest_version(config: FrigateConfig) -> str:
"https://api.github.com/repos/blakeblackshear/frigate/releases/latest",
timeout=10,
)
response = request.json()
except (RequestException, JSONDecodeError):
return "unknown"
response = request.json()
if request.ok and response and "tag_name" in response:
return str(response.get("tag_name").replace("v", ""))
else: