Skip to content

Commit

Permalink
Fix issues discovered in testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
IanYoung-BO committed Dec 27, 2023
1 parent ad11e53 commit c871f3a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions snyk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ def get_rest_pages(self, path: str, params: dict = {}) -> List:
)

# Process links to get the next url
if "next" in page_data.json()["links"]:
if "next" in page_data["links"]:
# If the next url is the same as the current url, break out of the loop
if page_data.json()["links"]["next"] == page_data.json()["links"]["self"]:
if "self" in page_data["links"] and page_data["links"]["next"] == page_data["links"]["self"]:
break
else:
next_url = page_data.get("links", {}).get("next")
Expand All @@ -247,7 +247,7 @@ def get_rest_pages(self, path: str, params: dict = {}) -> List:
# Verify that response contains data
if "data" in page_data:
# If the data is empty, break out of the loop
if page_data["data"].len() == 0:
if len(page_data["data"]) == 0:
break
# If response does not contain data, break out of the loop
else:
Expand Down

0 comments on commit c871f3a

Please sign in to comment.