From 45f1d54cfb21e6b7d7542e9ad4efc035ff10edd1 Mon Sep 17 00:00:00 2001 From: Savorboard Date: Sun, 19 Jan 2020 14:01:27 +0800 Subject: [PATCH] Try to fix azure service bus header cast exception. #483 --- .../AzureServiceBusConsumerClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DotNetCore.CAP.AzureServiceBus/AzureServiceBusConsumerClient.cs b/src/DotNetCore.CAP.AzureServiceBus/AzureServiceBusConsumerClient.cs index 06f14865d..0f97419be 100644 --- a/src/DotNetCore.CAP.AzureServiceBus/AzureServiceBusConsumerClient.cs +++ b/src/DotNetCore.CAP.AzureServiceBus/AzureServiceBusConsumerClient.cs @@ -159,7 +159,7 @@ private async Task ConnectAsync() private Task OnConsumerReceived(Message message, CancellationToken token) { - var header = message.UserProperties.ToDictionary(x => x.Key, y => y.Value.ToString()); + var header = message.UserProperties.ToDictionary(x => x.Key, y => y.Value?.ToString()); var context = new TransportMessage(header, message.Body);