aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Monteiro <marknr.monteiro@protonmail.com>2020-04-26 18:04:34 -0400
committerMark Monteiro <marknr.monteiro@protonmail.com>2020-04-26 18:04:34 -0400
commit15fd4812f09282e9b81f53845ce462f42ff1b5e9 (patch)
tree64cc28bae76d46828ac190c83868fb973fd36533
parent679f97d5e97d273076d886e99fe997bf8c2cb1b1 (diff)
Remove unnecessary foreach loop
-rw-r--r--Emby.Server.Implementations/ApplicationHost.cs7
1 files changed, 3 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index edfed67a1..8f20a4921 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -1187,13 +1187,12 @@ namespace Emby.Server.Implementations
{
// Return the first matched address, if found, or the first known local address
var addresses = await GetLocalIpAddressesInternal(false, 1, cancellationToken).ConfigureAwait(false);
-
- foreach (var address in addresses)
+ if (addresses.Count == 0)
{
- return GetLocalApiUrl(address);
+ return null;
}
- return null;
+ return GetLocalApiUrl(addresses.First());
}
catch (Exception ex)
{