diff --git a/status_cake_exporter/_status_cake.py b/status_cake_exporter/_status_cake.py index 593bf79..d943d08 100644 --- a/status_cake_exporter/_status_cake.py +++ b/status_cake_exporter/_status_cake.py @@ -182,7 +182,10 @@ def list_tests(self, tags: str = "") -> list[dict]: # Fetch the performance of each test and add it to the response for test in response: history = self.get_test_history(test["id"]) - test["performance"] = history["data"][0]["performance"] + if history["data"]: + test["performance"] = history["data"][0]["performance"] + else: + logger.warning(f"No performance data found for test ID {test['id']}") print(response) return response