From dfd4c967b767bbcd63cf79f81003d852bb98895e Mon Sep 17 00:00:00 2001 From: Kukks Date: Mon, 19 Apr 2021 07:43:03 +0200 Subject: [PATCH] fix null reference exception when no tor settings are provided --- BTCPayServer/Services/TorServices.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BTCPayServer/Services/TorServices.cs b/BTCPayServer/Services/TorServices.cs index f8dd1df2a..e1f2047e1 100644 --- a/BTCPayServer/Services/TorServices.cs +++ b/BTCPayServer/Services/TorServices.cs @@ -122,11 +122,11 @@ namespace BTCPayServer.Services public override async Task StartAsync(CancellationToken cancellationToken) { - if (string.IsNullOrEmpty(_options.Value.TorrcFile)) + if (string.IsNullOrEmpty(_options.Value.TorrcFile) && _options.Value.TorServices != null) { LoadFromConfig(); } - else + else if(!string.IsNullOrEmpty(_options.Value.TorrcFile)) { await Refresh(); await base.StartAsync(cancellationToken);