diff --git a/BTCPayServer/HostedServices/BaseAsyncService.cs b/BTCPayServer/HostedServices/BaseAsyncService.cs index 4512d1c5f..0c501aac6 100644 --- a/BTCPayServer/HostedServices/BaseAsyncService.cs +++ b/BTCPayServer/HostedServices/BaseAsyncService.cs @@ -57,7 +57,8 @@ namespace BTCPayServer.HostedServices if (_Cts != null) { _Cts.Cancel(); - await Task.WhenAll(_Tasks); + if (_Tasks != null) + await Task.WhenAll(_Tasks); } Logs.PayServer.LogInformation($"{this.GetType().Name} successfully exited..."); }