From df692a8e03cb0f90d724834448f1f7ab0354d7e9 Mon Sep 17 00:00:00 2001 From: danielui <58788881+danielui@users.noreply.github.com> Date: Tue, 30 May 2023 08:51:28 +0200 Subject: [PATCH] handle empty data in task status (#279) --- vmngclient/api/task_status_api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vmngclient/api/task_status_api.py b/vmngclient/api/task_status_api.py index b5f109ac5..3ec75b57b 100644 --- a/vmngclient/api/task_status_api.py +++ b/vmngclient/api/task_status_api.py @@ -114,7 +114,8 @@ def check_status(task_data: List[SubTaskData]) -> bool: Returns: bool: False if condition is met """ - + if not task_data: + return True task_statuses_success = [task.status in success_statuses for task in task_data] task_statuses_failure = [task.status in failure_statuses for task in task_data] task_statuses_id_success = [task.status_id in success_statuses_ids for task in task_data]