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
pull/6994/head
Stoica Tedy 3 years ago
parent 0872ede57b
commit 250332104b
No known key found for this signature in database
GPG Key ID: C29A238B2A1A7945

@ -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

Loading…
Cancel
Save