Browse Source

Fixed nullability on startupService

JPVenson 3 months ago
parent
commit
a05b3be1b3
1 changed files with 3 additions and 3 deletions
  1. 3 3
      Jellyfin.Server/Program.cs

+ 3 - 3
Jellyfin.Server/Program.cs

@@ -45,7 +45,7 @@ namespace Jellyfin.Server
         public const string LoggingConfigFileSystem = "logging.json";
         public const string LoggingConfigFileSystem = "logging.json";
 
 
         private static readonly SerilogLoggerFactory _loggerFactory = new SerilogLoggerFactory();
         private static readonly SerilogLoggerFactory _loggerFactory = new SerilogLoggerFactory();
-        private static SetupServer? _setupServer = new();
+        private static SetupServer _setupServer = new();
         private static CoreAppHost? _appHost;
         private static CoreAppHost? _appHost;
         private static IHost? _jfHost = null;
         private static IHost? _jfHost = null;
         private static long _startTimestamp;
         private static long _startTimestamp;
@@ -74,7 +74,7 @@ namespace Jellyfin.Server
         {
         {
             _startTimestamp = Stopwatch.GetTimestamp();
             _startTimestamp = Stopwatch.GetTimestamp();
             ServerApplicationPaths appPaths = StartupHelpers.CreateApplicationPaths(options);
             ServerApplicationPaths appPaths = StartupHelpers.CreateApplicationPaths(options);
-            await _setupServer!.RunAsync(static () => _jfHost?.Services?.GetService<INetworkManager>(), appPaths, static () => _appHost).ConfigureAwait(false);
+            await _setupServer.RunAsync(static () => _jfHost?.Services?.GetService<INetworkManager>(), appPaths, static () => _appHost).ConfigureAwait(false);
 
 
             // $JELLYFIN_LOG_DIR needs to be set for the logger configuration manager
             // $JELLYFIN_LOG_DIR needs to be set for the logger configuration manager
             Environment.SetEnvironmentVariable("JELLYFIN_LOG_DIR", appPaths.LogDirectoryPath);
             Environment.SetEnvironmentVariable("JELLYFIN_LOG_DIR", appPaths.LogDirectoryPath);
@@ -169,7 +169,7 @@ namespace Jellyfin.Server
 
 
                 try
                 try
                 {
                 {
-                    await _setupServer!.StopAsync().ConfigureAwait(false);
+                    await _setupServer.StopAsync().ConfigureAwait(false);
                     _setupServer.Dispose();
                     _setupServer.Dispose();
                     _setupServer = null!;
                     _setupServer = null!;
                     await _jfHost.StartAsync().ConfigureAwait(false);
                     await _jfHost.StartAsync().ConfigureAwait(false);