Skip to content

Commit dd38d66

Browse files
committed
Harden against empty 'projects.subscriptions.pull' responses.
1 parent f211c1d commit dd38d66

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

gcloud/pubsub/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ def subscription_pull(self, subscription_path, return_immediately=False,
416416
'maxMessages': max_messages,
417417
}
418418
response = conn.api_request(method='POST', path=path, data=data)
419-
return response['receivedMessages']
419+
return response.get('receivedMessages', ())
420420

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

0 commit comments

Comments
 (0)