From c24bb443d33c85958260076188b218af1fab262c Mon Sep 17 00:00:00 2001 From: rockstardev Date: Thu, 7 Nov 2019 23:36:55 -0600 Subject: [PATCH] Fixing check for external services that don't specify server --- BTCPayServer/Configuration/ExternalConnectionString.cs | 2 +- BTCPayServer/Views/Server/Services.cshtml | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/BTCPayServer/Configuration/ExternalConnectionString.cs b/BTCPayServer/Configuration/ExternalConnectionString.cs index e5c66fc34..24c90411d 100644 --- a/BTCPayServer/Configuration/ExternalConnectionString.cs +++ b/BTCPayServer/Configuration/ExternalConnectionString.cs @@ -144,7 +144,7 @@ namespace BTCPayServer.Configuration } public bool? IsOnion() { - if (!this.Server.IsAbsoluteUri) + if (this.Server == null || !this.Server.IsAbsoluteUri) return null; return this.Server.DnsSafeHost.EndsWith(".onion", StringComparison.OrdinalIgnoreCase); } diff --git a/BTCPayServer/Views/Server/Services.cshtml b/BTCPayServer/Views/Server/Services.cshtml index d908f5800..4794610c2 100644 --- a/BTCPayServer/Views/Server/Services.cshtml +++ b/BTCPayServer/Views/Server/Services.cshtml @@ -35,9 +35,8 @@ @s.CryptoCode @s.DisplayName - @if ((s.ConnectionString.IsOnion() is true) || - (s.ConnectionString.IsOnion() is false && - this.Context.Request.IsOnion())) + @if (s.ConnectionString.IsOnion() == true || + (s.ConnectionString.IsOnion() == false && this.Context.Request.IsOnion())) { }