aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/Events
diff options
context:
space:
mode:
authorPatrick Barron <barronpm@gmail.com>2021-06-18 18:47:44 -0400
committerPatrick Barron <barronpm@gmail.com>2021-06-18 18:56:10 -0400
commitbe88efce3cbbd357142a75f109258d6c7be398b4 (patch)
treedf8a0bf9d5e108d45a473edd8121a9af91ca6a0d /Jellyfin.Server.Implementations/Events
parent336ba2879f325a4efd52bc7737ce94f40369bfeb (diff)
parentc791c3a215b33bd4ca534c9f383c9fd7d23b59af (diff)
Merge branch 'master' into authenticationdb-efcore
# Conflicts: # Emby.Server.Implementations/Devices/DeviceManager.cs # Emby.Server.Implementations/HttpServer/Security/SessionContext.cs # Emby.Server.Implementations/Security/AuthenticationRepository.cs # Emby.Server.Implementations/Session/SessionManager.cs # Jellyfin.Server.Implementations/Security/AuthorizationContext.cs # MediaBrowser.Controller/Library/IUserManager.cs # MediaBrowser.Controller/Net/ISessionContext.cs
Diffstat (limited to 'Jellyfin.Server.Implementations/Events')
-rw-r--r--Jellyfin.Server.Implementations/Events/EventManager.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Jellyfin.Server.Implementations/Events/EventManager.cs b/Jellyfin.Server.Implementations/Events/EventManager.cs
index 707002442..8c5d8f2ce 100644
--- a/Jellyfin.Server.Implementations/Events/EventManager.cs
+++ b/Jellyfin.Server.Implementations/Events/EventManager.cs
@@ -30,7 +30,7 @@ namespace Jellyfin.Server.Implementations.Events
public void Publish<T>(T eventArgs)
where T : EventArgs
{
- Task.WaitAll(PublishInternal(eventArgs));
+ PublishInternal(eventArgs).GetAwaiter().GetResult();
}
/// <inheritdoc />
@@ -43,7 +43,12 @@ namespace Jellyfin.Server.Implementations.Events
private async Task PublishInternal<T>(T eventArgs)
where T : EventArgs
{
- using var scope = _appHost.ServiceProvider.CreateScope();
+ using var scope = _appHost.ServiceProvider?.CreateScope();
+ if (scope == null)
+ {
+ return;
+ }
+
foreach (var service in scope.ServiceProvider.GetServices<IEventConsumer<T>>())
{
try