소스 검색

Fixed crash in MigrationRunner

The crashed was caused by importing the migrationOptions even if the
migrations.xml file is non existant.
[Issue]: ~/.config/jellyfin/migrations.xml not found #6992
Stoica Tedy 3 년 전
부모
커밋
250332104b
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      Jellyfin.Server/Migrations/MigrationRunner.cs

+ 4 - 0
Jellyfin.Server/Migrations/MigrationRunner.cs

@@ -75,6 +75,10 @@ namespace Jellyfin.Server.Migrations
 
             var xmlSerializer = new MyXmlSerializer();
             var migrationConfigPath = Path.Join(appPaths.ConfigurationDirectoryPath, MigrationsListStore.StoreKey.ToLowerInvariant() + ".xml");
+            if (!File.Exists(migrationConfigPath))
+            {
+                return;
+            }
             var migrationOptions = (MigrationOptions)xmlSerializer.DeserializeFromFile(typeof(MigrationOptions), migrationConfigPath)!;
 
             // We have to deserialize it manually since the configuration manager may overwrite it