From 6a6663027a50f90253fffc9cb62c5e2d84ee1390 Mon Sep 17 00:00:00 2001 From: Inaki Fernandez Date: Sun, 12 Jul 2026 17:37:21 +0200 Subject: [PATCH] fix(health-checker): prevent TypeError when health_score is null in database --- src/intelligent_health_checker.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/intelligent_health_checker.py b/src/intelligent_health_checker.py index f0588645..931192bb 100644 --- a/src/intelligent_health_checker.py +++ b/src/intelligent_health_checker.py @@ -208,7 +208,9 @@ class IntelligentLinkCleaner: log_event("FINALIZING STATUS AND METRICS...", section_break=True) for url, (alive, reason, final) in check_results.items(): nu = normalize_url(url); entry = self.inventory.get(nu, {}) - score = entry.get("health_score", 100) + score = entry.get("health_score") + if score is None: + score = 100.0 score = (score * 0.8) + (100 if alive else 0) * 0.2 entry["health_score"] = round(score, 1); entry["last_checked"] = datetime.now().timestamp()