Skip to content

Commit 45f1d54

Browse files
committed
Try to fix azure service bus header cast exception. #483
1 parent 73949a4 commit 45f1d54

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/DotNetCore.CAP.AzureServiceBus/AzureServiceBusConsumerClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ private async Task ConnectAsync()
159159

160160
private Task OnConsumerReceived(Message message, CancellationToken token)
161161
{
162-
var header = message.UserProperties.ToDictionary(x => x.Key, y => y.Value.ToString());
162+
var header = message.UserProperties.ToDictionary(x => x.Key, y => y.Value?.ToString());
163163

164164
var context = new TransportMessage(header, message.Body);
165165

0 commit comments

Comments
 (0)