mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-29 11:54:27 +01:00
Prevent NRE on NBxplorer listener
This commit is contained in:
@@ -385,10 +385,13 @@ namespace BTCPayServer.Payments.Bitcoin
|
||||
}
|
||||
public async Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
leases.Dispose();
|
||||
_Cts.Cancel();
|
||||
await Task.WhenAny(_RunningTask.Task, Task.Delay(-1, cancellationToken));
|
||||
Logs.PayServer.LogInformation($"{this.GetType().Name} successfully exited...");
|
||||
if (_Cts != null)
|
||||
{
|
||||
leases.Dispose();
|
||||
_Cts.Cancel();
|
||||
await Task.WhenAny(_RunningTask.Task, Task.Delay(-1, cancellationToken));
|
||||
Logs.PayServer.LogInformation($"{this.GetType().Name} successfully exited...");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user