Skip to content

Commit 4ce642b

Browse files
committed
Nullable enable
1 parent 6b4b1f2 commit 4ce642b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/NServiceBus.Transport.RabbitMQ/Connection/ChannelProvider.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#nullable enable
2+
13
namespace NServiceBus.Transport.RabbitMQ
24
{
35
using System;
@@ -28,9 +30,9 @@ IConnection CreateWiredUpConnection()
2830
return newConnection;
2931
}
3032

31-
void Connection_ConnectionShutdown(object sender, ShutdownEventArgs e)
33+
void Connection_ConnectionShutdown(object? sender, ShutdownEventArgs e)
3234
{
33-
if (e.Initiator == ShutdownInitiator.Application)
35+
if (e.Initiator == ShutdownInitiator.Application || sender is null)
3436
{
3537
return;
3638
}
@@ -129,7 +131,7 @@ public void Dispose()
129131
readonly IRoutingTopology routingTopology;
130132
readonly ConcurrentQueue<ConfirmsAwareChannel> channels;
131133
readonly CancellationTokenSource stoppingTokenSource = new();
132-
volatile IConnection connection;
134+
volatile IConnection? connection;
133135
bool disposed;
134136

135137
static readonly ILog Logger = LogManager.GetLogger(typeof(ChannelProvider));

0 commit comments

Comments
 (0)