Selaa lähdekoodia

Fix NRE in DisposeAsyncCore

MBR#0001 2 vuotta sitten
vanhempi
sitoutus
c338aa7cb5
1 muutettua tiedostoa jossa 6 lisäystä ja 3 poistoa
  1. 6 3
      Emby.Server.Implementations/ApplicationHost.cs

+ 6 - 3
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);
+                }
             }
         }
     }