Skip to content

Commit

Permalink
Handle None value for items in ERS response
Browse files Browse the repository at this point in the history
  • Loading branch information
aparekh-crest committed Apr 12, 2024
1 parent 89c012f commit 5fef53e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ciscoise_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5fef53e

Please sign in to comment.