fix null reference exception when no tor settings are provided

This commit is contained in:
Kukks
2021-04-19 07:43:03 +02:00
parent ee0fa71605
commit dfd4c967b7

View File

@@ -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);