Catch intel stats json decoding error

This commit is contained in:
Nicolas Mowen 2024-10-21 07:48:31 -06:00
parent 65bb33d1c7
commit 4a35b52bef

View File

@ -279,7 +279,11 @@ def get_intel_gpu_stats() -> dict[str, str]:
logger.error(f"Unable to poll intel GPU stats: {p.stderr}")
return None
else:
data = json.loads(f'[{"".join(p.stdout.split())}]')
try:
data = json.loads(f'[{"".join(p.stdout.split())}]')
except json.JSONDecodeError:
return None
results: dict[str, str] = {}
render = {"global": []}
video = {"global": []}