From 24a17712e7fbc1c7404d56feaed8cbb78af2f05c Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sat, 9 Apr 2022 23:09:21 +0000 Subject: [PATCH] skip on empty dict --- api/tacticalrmm/agents/tasks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/tacticalrmm/agents/tasks.py b/api/tacticalrmm/agents/tasks.py index 050289f6..71fbba14 100644 --- a/api/tacticalrmm/agents/tasks.py +++ b/api/tacticalrmm/agents/tasks.py @@ -291,8 +291,9 @@ def clear_faults_task(older_than_days: int) -> None: for agent in agents: for check in agent.get_checks_with_policies(): # reset check status - check.check_result.status = "passing" - check.check_result.save(update_fields=["status"]) + if check.check_result: + check.check_result.status = "passing" + check.check_result.save(update_fields=["status"]) if check.alert.filter(agent=agent, resolved=False).exists(): alert = Alert.create_or_return_check_alert(check, agent=agent) if alert: