More careful with results.

This commit is contained in:
Ralph Bean 2013-12-11 18:36:04 +00:00
parent b4fa4af74a
commit 97cca8dab9

View file

@ -65,10 +65,10 @@ def get_g_plus_persons():
response = requests.get(g_plus_url, params=params)
body = response.json()
token = body['nextPageToken']
token = body.get('nextPageToken', None)
# No more results
if not body['items']:
if not body.get('items', None):
break
# Otherwise, we have a page to process