浏览代码

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