From 087d4153aed8a82651a057ddf898dea7f97ded4a Mon Sep 17 00:00:00 2001 From: Phlogi Date: Sun, 24 Mar 2019 21:47:18 +0100 Subject: [PATCH] Fix check for available WAN address. --- Emby.Server.Implementations/ApplicationHost.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 8f66ff5f98..52d5255525 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1372,10 +1372,13 @@ namespace Emby.Server.Implementations public async Task GetSystemInfo(CancellationToken cancellationToken) { var localAddress = await GetLocalApiUrl(cancellationToken).ConfigureAwait(false); - var wanAddress = GetWanApiUrl(ServerConfigurationManager.Configuration.WanDdns); + var wanAddress = System.String.Empty; - if (string.IsNullOrEmpty(wanAddress)){ + if (string.IsNullOrEmpty(ServerConfigurationManager.Configuration.WanDdns)){ wanAddress = await GetWanApiUrl(cancellationToken).ConfigureAwait(false); + } else + { + wanAddress = GetWanApiUrl(ServerConfigurationManager.Configuration.WanDdns); } return new SystemInfo @@ -1425,11 +1428,14 @@ namespace Emby.Server.Implementations public async Task GetPublicSystemInfo(CancellationToken cancellationToken) { - var localAddress = await GetLocalApiUrl(cancellationToken).ConfigureAwait(false); - var wanAddress = GetWanApiUrl(ServerConfigurationManager.Configuration.WanDdns); + var localAddress = await GetLocalApiUrl(cancellationToken).ConfigureAwait(false); + var wanAddress = System.String.Empty; - if (string.IsNullOrEmpty(wanAddress)){ + if (string.IsNullOrEmpty(ServerConfigurationManager.Configuration.WanDdns)){ wanAddress = await GetWanApiUrl(cancellationToken).ConfigureAwait(false); + } else + { + wanAddress = GetWanApiUrl(ServerConfigurationManager.Configuration.WanDdns); } return new PublicSystemInfo {