diff --git a/fixbackend/inventory/inventory_service.py b/fixbackend/inventory/inventory_service.py index 5fd011d0..da3f1b5c 100644 --- a/fixbackend/inventory/inventory_service.py +++ b/fixbackend/inventory/inventory_service.py @@ -477,8 +477,12 @@ def populate_info(accounts: List[Json]) -> None: failed_checks: Dict[ReportSeverity, int] = {} failed_resource_checks: Dict[ReportSeverity, int] = {} + if not isinstance(info, dict): + continue + # "failed": { "high": { "checks": 6, "resources": 14 }, "low": { "checks": 4, "resources": 7 }} for severity, severity_info in info.get("failed", {}).items(): + checks = severity_info["checks"] failed_checks[severity] = checks failed_resource_checks[severity] = severity_info["resources"]