diff --git a/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs b/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs index c345e122f3..6ac4d2d5d2 100644 --- a/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs +++ b/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs @@ -47,6 +47,13 @@ namespace MediaBrowser.Common.Implementations.Security private IJsonSerializer _jsonSerializer; private IApplicationHost _appHost; private IEnumerable _registeredEntities; + protected IEnumerable RegisteredEntities + { + get + { + return _registeredEntities ?? (_registeredEntities = _appHost.GetExports()); + } + } /// /// Initializes a new instance of the class. @@ -61,7 +68,6 @@ namespace MediaBrowser.Common.Implementations.Security _appHost = appHost; _httpClient = httpClient; _jsonSerializer = jsonSerializer; - _registeredEntities = _appHost.GetExports(); MBRegistration.Init(appPaths); } @@ -74,7 +80,7 @@ namespace MediaBrowser.Common.Implementations.Security var tasks = new List(); ResetSupporterInfo(); - tasks.AddRange(_registeredEntities.Select(i => i.LoadRegistrationInfoAsync())); + tasks.AddRange(RegisteredEntities.Select(i => i.LoadRegistrationInfoAsync())); await Task.WhenAll(tasks); }