From b5ebd14589a5473b04023d67e0b1b5e5d131cd79 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Tue, 12 Oct 2021 17:39:48 +0900 Subject: [PATCH] Fix NRE in BaseService.StopAsync --- BTCPayServer/HostedServices/BaseAsyncService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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..."); }