From 0f62e36bbd3d21c1b47277803bdb8e5bbdd0cbd7 Mon Sep 17 00:00:00 2001 From: Cizz22 Date: Thu, 9 Oct 2025 12:07:38 +0700 Subject: [PATCH] fix --- src/aeros_equipment/service.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/aeros_equipment/service.py b/src/aeros_equipment/service.py index 1584182..493e651 100644 --- a/src/aeros_equipment/service.py +++ b/src/aeros_equipment/service.py @@ -255,12 +255,14 @@ def get_asset_batch(location_tags: List[str], nr_location_tags: List[str], response.raise_for_status() # Raises an HTTPError for bad responses data = response.json() reliabiility_data = data.get("data", []) - - print(reliabiility_data) - for item in reliabiility_data: - location_tag = item["location_tag"] + location_tag = item.get("location_tag", None) + + if not location_tag: + print("Error processing item" + str(item)) + continue + try: is_nr = item["distribution"] != "NHPP" mtbf = item["mtbf"]