From 5fef53eb279f19101158b6302a89058ff1c5e7a3 Mon Sep 17 00:00:00 2001 From: aparekh-crest Date: Fri, 12 Apr 2024 15:36:01 +0530 Subject: [PATCH] Handle None value for items in ERS response --- ciscoise_connector.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ciscoise_connector.py b/ciscoise_connector.py index d34f4a5..4f3323b 100644 --- a/ciscoise_connector.py +++ b/ciscoise_connector.py @@ -440,8 +440,10 @@ def _paginator(self, endpoint, action_result, limit=None): self.debug_print("Call to ERS API Failed") return None items_from_page = items.get("SearchResult", {}).get("resources") - items_list.extend(items_from_page) - self.debug_print("Retrieved {} records from the endpoint {}".format(len(items_from_page), endpoint)) + if items_from_page is not None: + items_list.extend(items_from_page) + self.debug_print("Retrieved {} records from the endpoint {}".format(len(items_from_page), endpoint)) + next_page_dict = items.get("SearchResult", {}).get("nextPage") if next_page_dict is not None: