Skip to content

Commit 9b1620c

Browse files
dsarnoclaude
andauthored
fix: guard against null progress in nudge check (#806)
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 <noreply@anthropic.com>
1 parent f08bd45 commit 9b1620c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Server/src/services/tools/run_tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ async def _fetch_status() -> dict[str, Any]:
282282
# This handles OS-level throttling (e.g., macOS App Nap) that can
283283
# stall PlayMode tests when Unity is in the background.
284284
# Uses exponential backoff: 1s, 2s, 4s, 8s, 10s max between nudges.
285-
progress = data.get("progress", {})
285+
progress = data.get("progress") or {}
286286
editor_is_focused = progress.get("editor_is_focused", True)
287287
current_time_ms = int(time.time() * 1000)
288288

@@ -324,7 +324,7 @@ async def _fetch_status() -> dict[str, Any]:
324324
data = response.get("data", {})
325325
status = data.get("status", "")
326326
if status == "running":
327-
progress = data.get("progress", {})
327+
progress = data.get("progress") or {}
328328
editor_is_focused = progress.get("editor_is_focused", True)
329329
last_update_unix_ms = data.get("last_update_unix_ms")
330330
current_time_ms = int(time.time() * 1000)

0 commit comments

Comments
 (0)