fix: handle NaN output_level in state gathering to prevent crash

This commit is contained in:
2026-06-13 12:24:32 -04:00
parent 6e07aa2b38
commit cd2ed273e9
+4 -1
View File
@@ -15,7 +15,8 @@ import asyncio
import json
import os
import logging
import time
import math
import mimetypes
import datetime
from contextlib import asynccontextmanager
from dataclasses import dataclass, field
@@ -1651,11 +1652,13 @@ class WebServer:
"input_level": (
min(100, round((getattr(pl, '_input_level', 0.0) or 0.0) * 150))
if pl and isinstance(getattr(pl, '_input_level', None), (int, float))
and not math.isnan(getattr(pl, '_input_level', 0.0))
else 0
),
"output_level": (
min(100, round((getattr(pl, '_output_level', 0.0) or 0.0) * 150))
if pl and isinstance(getattr(pl, '_output_level', None), (int, float))
and not math.isnan(getattr(pl, '_output_level', 0.0))
else 0
),
# System stats