Skip to content

Commit

Permalink
Guard against infinite recursion in pagination.
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot authored and rattrayalex committed Jul 18, 2022
1 parent 70f9538 commit 6d23860
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lithic/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ class BasePage(GenericModel, Generic[ModelT, PageParamsT]):
_model: Type[ModelT] = PrivateAttr()

def has_next_page(self) -> bool:
items = self._get_page_items()
if not items:
return False
return self.next_page_params() is not None

def next_page_params(self) -> Optional[PageParamsT]:
Expand Down

0 comments on commit 6d23860

Please sign in to comment.