mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-21 13:10:45 +02:00
Remove unnecessary foreach loop
This commit is contained in:
parent
679f97d5e9
commit
15fd4812f0
|
@ -1187,13 +1187,12 @@ namespace Emby.Server.Implementations
|
||||||
{
|
{
|
||||||
// Return the first matched address, if found, or the first known local address
|
// Return the first matched address, if found, or the first known local address
|
||||||
var addresses = await GetLocalIpAddressesInternal(false, 1, cancellationToken).ConfigureAwait(false);
|
var addresses = await GetLocalIpAddressesInternal(false, 1, cancellationToken).ConfigureAwait(false);
|
||||||
|
if (addresses.Count == 0)
|
||||||
foreach (var address in addresses)
|
|
||||||
{
|
{
|
||||||
return GetLocalApiUrl(address);
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return GetLocalApiUrl(addresses.First());
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue