aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/Events
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2021-05-28 14:33:54 +0200
committerBond_009 <bond.009@outlook.com>2021-05-28 14:33:54 +0200
commit0bc06014427e36a770adeda66392d08147658ea8 (patch)
tree0a0e5bd77f9f6fec947f64743c316d11e1dde7e7 /Jellyfin.Server.Implementations/Events
parentb12f509de3f8a55f6b3bfc74cfa66a39fd10d24b (diff)
Fix some warnings
Diffstat (limited to 'Jellyfin.Server.Implementations/Events')
-rw-r--r--Jellyfin.Server.Implementations/Events/EventManager.cs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Jellyfin.Server.Implementations/Events/EventManager.cs b/Jellyfin.Server.Implementations/Events/EventManager.cs
index 707002442..c5e66112d 100644
--- a/Jellyfin.Server.Implementations/Events/EventManager.cs
+++ b/Jellyfin.Server.Implementations/Events/EventManager.cs
@@ -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