diff --git a/AzureCP/Yvand.ClaimsProviders/Configuration/AzureAD/AADEntityProviderConfig.cs b/AzureCP/Yvand.ClaimsProviders/Configuration/AzureAD/AADEntityProviderConfig.cs index 0ca4ef4f..feb453a3 100644 --- a/AzureCP/Yvand.ClaimsProviders/Configuration/AzureAD/AADEntityProviderConfig.cs +++ b/AzureCP/Yvand.ClaimsProviders/Configuration/AzureAD/AADEntityProviderConfig.cs @@ -16,7 +16,7 @@ public interface IAADSettings : IEntityProviderSettings public class AADEntityProviderSettings : EntityProviderSettings, IAADSettings { - public List AzureTenants { get; set; } + public List AzureTenants { get; set; } = new List(); public string ProxyAddress { get; set; } @@ -117,11 +117,13 @@ public override bool InitializeDefaultSettings() protected override bool InitializeInternalRuntimeSettings() { bool success = base.InitializeInternalRuntimeSettings(); - foreach (var tenant in this.AzureTenants) + if (this.AzureTenants != null) { - tenant.InitializeAuthentication(this.Timeout, this.ProxyAddress); + foreach (var tenant in this.AzureTenants) + { + tenant.InitializeAuthentication(this.Timeout, this.ProxyAddress); + } } - return success; }