From 04ce744610790fb1b24e6a67064d4617a19940aa Mon Sep 17 00:00:00 2001 From: David Sarno Date: Sat, 21 Feb 2026 11:18:48 -0800 Subject: [PATCH] fix: guard against null progress in nudge check data.get('progress', {}) returns None when key exists with null value. Use 'or {}' fallback to prevent AttributeError on progress.get(). Co-Authored-By: Claude Opus 4.6 --- Server/src/services/tools/run_tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Server/src/services/tools/run_tests.py b/Server/src/services/tools/run_tests.py index d3eb8aa59..44cd385ba 100644 --- a/Server/src/services/tools/run_tests.py +++ b/Server/src/services/tools/run_tests.py @@ -282,7 +282,7 @@ async def _fetch_status() -> dict[str, Any]: # This handles OS-level throttling (e.g., macOS App Nap) that can # stall PlayMode tests when Unity is in the background. # Uses exponential backoff: 1s, 2s, 4s, 8s, 10s max between nudges. - progress = data.get("progress", {}) + progress = data.get("progress") or {} editor_is_focused = progress.get("editor_is_focused", True) current_time_ms = int(time.time() * 1000) @@ -324,7 +324,7 @@ async def _fetch_status() -> dict[str, Any]: data = response.get("data", {}) status = data.get("status", "") if status == "running": - progress = data.get("progress", {}) + progress = data.get("progress") or {} editor_is_focused = progress.get("editor_is_focused", True) last_update_unix_ms = data.get("last_update_unix_ms") current_time_ms = int(time.time() * 1000)