diff --git a/sources/rest_api/paginators.py b/sources/rest_api/paginators.py index f0d9ffa42..e63754e85 100644 --- a/sources/rest_api/paginators.py +++ b/sources/rest_api/paginators.py @@ -182,7 +182,10 @@ def __init__( self._records_accessor = create_nested_accessor(records_key) def update_state(self, response: Response): - self.next_reference = self._next_key_accessor(response.json()) + try: + self.next_reference = self._next_key_accessor(response.json()) + except KeyError: + self.next_reference = None def extract_records(self, response: Response) -> Any: return self._records_accessor(response.json())