From 250332104b18bafee415ab1a69b2b355f9c18f6b Mon Sep 17 00:00:00 2001 From: Stoica Tedy Date: Tue, 14 Dec 2021 09:31:35 +0200 Subject: [PATCH] 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 --- Jellyfin.Server/Migrations/MigrationRunner.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Jellyfin.Server/Migrations/MigrationRunner.cs b/Jellyfin.Server/Migrations/MigrationRunner.cs index a6886c64a..825cf7338 100644 --- a/Jellyfin.Server/Migrations/MigrationRunner.cs +++ b/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