!wip fixed an error in the emby servers code

This commit is contained in:
tidusjar 2017-10-01 21:43:31 +01:00
commit 9bb29aac33
2 changed files with 2 additions and 2 deletions

View file

@ -5,7 +5,7 @@ namespace Ombi.Core.Settings.Models.External
public sealed class EmbySettings : Ombi.Settings.Settings.Models.Settings
{
public bool Enable { get; set; }
public List<EmbyServers> Servers { get; set; }
public List<EmbyServers> Servers { get; set; } = new List<EmbyServers>();
}
public class EmbyServers : ExternalSettings

View file

@ -72,7 +72,7 @@ namespace Ombi.Controllers.External
{
var vm = new List<UsersViewModel>();
var s = await EmbySettings.GetSettingsAsync();
foreach (var server in s.Servers)
foreach (var server in s?.Servers ?? new List<EmbyServers>())
{
var users = await EmbyApi.GetUsers(server.FullUri, server.ApiKey);
if (users != null && users.Any())