Skip to content

Commit

Permalink
Modified loop terminate condition to avoid KeyError
Browse files Browse the repository at this point in the history
  • Loading branch information
Hrishabh17 committed Mar 5, 2024
1 parent 07adae5 commit 8e32a25
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion qbosdk/apis/api_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def _query_get_all_generator(self, object_type: str, url: str) -> Generator[Dict
data = json.loads(response.text)
query_response = data['QueryResponse']

if not query_response[object_type]:
if not query_response or object_type not in query_response:
break

for obj in query_response[object_type]:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name='qbosdk',
version='0.17.0',
version='0.17.1',
author='Shwetabh Kumar',
author_email='[email protected]',
description='Python SDK for accessing Quickbooks Online APIs',
Expand Down

0 comments on commit 8e32a25

Please sign in to comment.