Skip to content

Commit 6ad0888

Browse files
Copilotkamilbaczek
andcommitted
Fix null reference dereference in EventBusModule
Co-authored-by: kamilbaczek <74410956+kamilbaczek@users.noreply.github.com>
1 parent 3cb0fc7 commit 6ad0888

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

  • Chapter-4-applying-tactical-domain-driven-design

Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/EventBus/EventBusModule.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ internal static IServiceCollection AddEventBus(this IServiceCollection services,
2424
return;
2525
}
2626

27-
var uri = options.Value.Uri;
28-
var username = options.Value.Username;
29-
var password = options.Value.Password;
27+
var uri = options.Value?.Uri;
28+
var username = options.Value?.Username;
29+
var password = options.Value?.Password;
3030

3131
if (!string.IsNullOrEmpty(uri))
3232
{

Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.Api/Common/EventBus/EventBusModule.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ internal static IServiceCollection AddEventBus(this IServiceCollection services,
2727
return;
2828
}
2929

30-
var uri = options.Value.Uri;
31-
var username = options.Value.Username;
32-
var password = options.Value.Password;
30+
var uri = options.Value?.Uri;
31+
var username = options.Value?.Username;
32+
var password = options.Value?.Password;
3333

3434
if (!string.IsNullOrEmpty(uri))
3535
{

0 commit comments

Comments
 (0)