From 2a1939f37a71814e806b139626b550e3a1dd634b Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Thu, 12 Jun 2025 20:21:01 -0700 Subject: [PATCH] raylib: fix Firehose parsing v2 --- selfdrive/ui/layouts/settings/firehose.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/selfdrive/ui/layouts/settings/firehose.py b/selfdrive/ui/layouts/settings/firehose.py index 602d2d807b..864797be6f 100644 --- a/selfdrive/ui/layouts/settings/firehose.py +++ b/selfdrive/ui/layouts/settings/firehose.py @@ -51,10 +51,12 @@ class FirehoseLayout(Widget): def _get_segment_count(self) -> int: stats = self.params.get(self.PARAM_KEY, encoding='utf8') + if not stats: + return 0 try: return int(json.loads(stats).get("firehose", 0)) - except json.JSONDecodeError: - cloudlog.error(f"Failed to decode firehose stats: {stats}") + except (json.JSONDecodeError, TypeError, ValueError): + cloudlog.exception(f"Failed to decode firehose stats: {stats}") return 0 def __del__(self):