More careful with results.
This commit is contained in:
parent
b4fa4af74a
commit
97cca8dab9
1 changed files with 2 additions and 2 deletions
|
@ -65,10 +65,10 @@ def get_g_plus_persons():
|
||||||
|
|
||||||
response = requests.get(g_plus_url, params=params)
|
response = requests.get(g_plus_url, params=params)
|
||||||
body = response.json()
|
body = response.json()
|
||||||
token = body['nextPageToken']
|
token = body.get('nextPageToken', None)
|
||||||
|
|
||||||
# No more results
|
# No more results
|
||||||
if not body['items']:
|
if not body.get('items', None):
|
||||||
break
|
break
|
||||||
|
|
||||||
# Otherwise, we have a page to process
|
# Otherwise, we have a page to process
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue