mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-01-22 20:18:30 +03:00
Correctly catch JSONDecodeError
This commit is contained in:
parent
ec6fd2289c
commit
aaec0f6e92
@ -42,11 +42,10 @@ def get_latest_version(config: FrigateConfig) -> str:
|
|||||||
"https://api.github.com/repos/blakeblackshear/frigate/releases/latest",
|
"https://api.github.com/repos/blakeblackshear/frigate/releases/latest",
|
||||||
timeout=10,
|
timeout=10,
|
||||||
)
|
)
|
||||||
|
response = request.json()
|
||||||
except (RequestException, JSONDecodeError):
|
except (RequestException, JSONDecodeError):
|
||||||
return "unknown"
|
return "unknown"
|
||||||
|
|
||||||
response = request.json()
|
|
||||||
|
|
||||||
if request.ok and response and "tag_name" in response:
|
if request.ok and response and "tag_name" in response:
|
||||||
return str(response.get("tag_name").replace("v", ""))
|
return str(response.get("tag_name").replace("v", ""))
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user