Skip to content

Commit

Permalink
Harden against empty 'projects.subscriptions.pull' responses.
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver committed Apr 28, 2016
1 parent f211c1d commit dd38d66
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gcloud/pubsub/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ def subscription_pull(self, subscription_path, return_immediately=False,
'maxMessages': max_messages,
}
response = conn.api_request(method='POST', path=path, data=data)
return response['receivedMessages']
return response.get('receivedMessages', ())

def subscription_acknowledge(self, subscription_path, ack_ids):
"""API call: acknowledge retrieved messages for the subscription.
Expand Down

0 comments on commit dd38d66

Please sign in to comment.