Fixing check for external services that don't specify server

This commit is contained in:
rockstardev
2019-11-07 23:36:55 -06:00
parent 9c165d84ef
commit c24bb443d3
2 changed files with 3 additions and 4 deletions

View File

@@ -144,7 +144,7 @@ namespace BTCPayServer.Configuration
} }
public bool? IsOnion() public bool? IsOnion()
{ {
if (!this.Server.IsAbsoluteUri) if (this.Server == null || !this.Server.IsAbsoluteUri)
return null; return null;
return this.Server.DnsSafeHost.EndsWith(".onion", StringComparison.OrdinalIgnoreCase); return this.Server.DnsSafeHost.EndsWith(".onion", StringComparison.OrdinalIgnoreCase);
} }

View File

@@ -35,9 +35,8 @@
<td>@s.CryptoCode</td> <td>@s.CryptoCode</td>
<td> <td>
<span>@s.DisplayName</span> <span>@s.DisplayName</span>
@if ((s.ConnectionString.IsOnion() is true) || @if (s.ConnectionString.IsOnion() == true ||
(s.ConnectionString.IsOnion() is false && (s.ConnectionString.IsOnion() == false && this.Context.Request.IsOnion()))
this.Context.Request.IsOnion()))
{ {
<span><img style="display:inline; margin-top:-8px;" src="~/img/icons/Onion_Color.svg" height="20" /></span> <span><img style="display:inline; margin-top:-8px;" src="~/img/icons/Onion_Color.svg" height="20" /></span>
} }