Skip to content

Commit

Permalink
Fixes a NullReferenceExceptio error.
Browse files Browse the repository at this point in the history
  • Loading branch information
Codespilot committed Dec 12, 2023
1 parent c2e0b46 commit ead9d75
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Source/Euonia.Bus.InMemory/InMemoryDispatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public InMemoryDispatcher(IServiceProvider provider)
public async Task PublishAsync<TMessage>(RoutedMessage<TMessage> message, CancellationToken cancellationToken = default)
where TMessage : class
{
var context = new MessageContext(message, _identity.GetIdentity);
var context = new MessageContext(message, authorization => _identity?.GetIdentity(authorization));
var pack = new MessagePack(message, context)
{
Aborted = cancellationToken
Expand All @@ -39,7 +39,7 @@ public async Task PublishAsync<TMessage>(RoutedMessage<TMessage> message, Cancel
public async Task SendAsync<TMessage>(RoutedMessage<TMessage> message, CancellationToken cancellationToken = default)
where TMessage : class
{
var context = new MessageContext(message, _identity.GetIdentity);
var context = new MessageContext(message, authorization => _identity?.GetIdentity(authorization));
var pack = new MessagePack(message, context)
{
Aborted = cancellationToken
Expand Down Expand Up @@ -73,7 +73,7 @@ public async Task SendAsync<TMessage>(RoutedMessage<TMessage> message, Cancellat
public async Task<TResponse> SendAsync<TMessage, TResponse>(RoutedMessage<TMessage, TResponse> message, CancellationToken cancellationToken = default)
where TMessage : class
{
var context = new MessageContext(message, _identity.GetIdentity);
var context = new MessageContext(message, authorization => _identity?.GetIdentity(authorization));
var pack = new MessagePack(message, context)
{
Aborted = cancellationToken
Expand Down
2 changes: 1 addition & 1 deletion Source/Euonia.Bus.RabbitMq/RabbitMqQueueConsumer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected override async void HandleMessageReceived(object sender, BasicDeliverE

var props = args.BasicProperties;

var context = new MessageContext(message, _identity.GetIdentity);
var context = new MessageContext(message, authorization => _identity?.GetIdentity(authorization));

OnMessageReceived(new MessageReceivedEventArgs(message.Data, context));

Expand Down
2 changes: 1 addition & 1 deletion Source/Euonia.Bus.RabbitMq/RabbitMqTopicSubscriber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected override async void HandleMessageReceived(object sender, BasicDeliverE

var message = DeserializeMessage(args.Body.ToArray(), type);

var context = new MessageContext(message, _identity.GetIdentity);
var context = new MessageContext(message, authorization => _identity?.GetIdentity(authorization));

OnMessageReceived(new MessageReceivedEventArgs(message.Data, context));

Expand Down

0 comments on commit ead9d75

Please sign in to comment.