Correct use of local variable wanAddress.

This commit is contained in:
Phlogi 2019-03-25 22:26:05 +01:00 committed by GitHub
parent 1b03f078b9
commit 122cba2aa7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1373,13 +1373,15 @@ namespace Emby.Server.Implementations
{ {
var localAddress = await GetLocalApiUrl(cancellationToken).ConfigureAwait(false); var localAddress = await GetLocalApiUrl(cancellationToken).ConfigureAwait(false);
string wanAddress;
if (string.IsNullOrEmpty(ServerConfigurationManager.Configuration.WanDdns)) if (string.IsNullOrEmpty(ServerConfigurationManager.Configuration.WanDdns))
{ {
var wanAddress = await GetWanApiUrlFromExternal(cancellationToken).ConfigureAwait(false); wanAddress = await GetWanApiUrlFromExternal(cancellationToken).ConfigureAwait(false);
} }
else else
{ {
var wanAddress = GetWanApiUrl(ServerConfigurationManager.Configuration.WanDdns); wanAddress = GetWanApiUrl(ServerConfigurationManager.Configuration.WanDdns);
} }
return new SystemInfo return new SystemInfo
@ -1431,13 +1433,15 @@ namespace Emby.Server.Implementations
{ {
var localAddress = await GetLocalApiUrl(cancellationToken).ConfigureAwait(false); var localAddress = await GetLocalApiUrl(cancellationToken).ConfigureAwait(false);
string wanAddress;
if (string.IsNullOrEmpty(ServerConfigurationManager.Configuration.WanDdns)) if (string.IsNullOrEmpty(ServerConfigurationManager.Configuration.WanDdns))
{ {
var wanAddress = await GetWanApiUrlFromExternal(cancellationToken).ConfigureAwait(false); wanAddress = await GetWanApiUrlFromExternal(cancellationToken).ConfigureAwait(false);
} }
else else
{ {
var wanAddress = GetWanApiUrl(ServerConfigurationManager.Configuration.WanDdns); wanAddress = GetWanApiUrl(ServerConfigurationManager.Configuration.WanDdns);
} }
return new PublicSystemInfo return new PublicSystemInfo
{ {