From c338aa7cb5c1ce2c011a419c251184d247ea1e5b Mon Sep 17 00:00:00 2001 From: MBR#0001 Date: Wed, 15 Feb 2023 21:07:36 +0100 Subject: [PATCH] Fix NRE in DisposeAsyncCore --- Emby.Server.Implementations/ApplicationHost.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 37a9e7715..d104058cc 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1184,10 +1184,13 @@ namespace Emby.Server.Implementations } } - // used for closing websockets - foreach (var session in _sessionManager.Sessions) + if (_sessionManager != null) { - await session.DisposeAsync().ConfigureAwait(false); + // used for closing websockets + foreach (var session in _sessionManager.Sessions) + { + await session.DisposeAsync().ConfigureAwait(false); + } } } }