Skip to content

Commit 6d23860

Browse files
stainless-botrattrayalex
authored andcommitted
Guard against infinite recursion in pagination.
1 parent 70f9538 commit 6d23860

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lithic/_base_client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ class BasePage(GenericModel, Generic[ModelT, PageParamsT]):
7070
_model: Type[ModelT] = PrivateAttr()
7171

7272
def has_next_page(self) -> bool:
73+
items = self._get_page_items()
74+
if not items:
75+
return False
7376
return self.next_page_params() is not None
7477

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

0 commit comments

Comments
 (0)