diff --git a/Olive.Aws.EventBus/EventBusQueue.cs b/Olive.Aws.EventBus/EventBusQueue.cs index e64cecc87..9f9c1cef2 100644 --- a/Olive.Aws.EventBus/EventBusQueue.cs +++ b/Olive.Aws.EventBus/EventBusQueue.cs @@ -152,7 +152,7 @@ public async Task PullAll(Func handler) public async Task> PullBatch(int timeoutSeconds = 10, int? maxNumberOfMessages = null) { var result = new List(); - + var request = new ReceiveMessageRequest { QueueUrl = QueueUrl, @@ -160,15 +160,15 @@ public async Task> PullBatch(int timeoutSeconds MaxNumberOfMessages = maxNumberOfMessages ?? MaxNumberOfMessages, VisibilityTimeout = VisibilityTimeout, }; - + var response = await Client.ReceiveMessageAsync(request); - - foreach (var item in response.Messages) + + foreach (var item in response.Messages ?? []) { var receipt = new DeleteMessageRequest { QueueUrl = QueueUrl, ReceiptHandle = item.ReceiptHandle }; result.Add(new QueueMessageHandle(item.Body, item.MessageId, () => Client.DeleteMessageAsync(receipt))); } - + return result; } diff --git a/Olive.Aws.EventBus/Olive.Aws.EventBus.csproj b/Olive.Aws.EventBus/Olive.Aws.EventBus.csproj index 02bd9152c..d6b93bed0 100644 --- a/Olive.Aws.EventBus/Olive.Aws.EventBus.csproj +++ b/Olive.Aws.EventBus/Olive.Aws.EventBus.csproj @@ -1,7 +1,7 @@  netstandard2.0 - 8.0.1 + 8.0.2