Merge pull request #6994 from Tedyst/master

Fixed crash in MigrationRunner by checking migration for file existance
This commit is contained in:
Cody Robibero 2021-12-14 05:02:31 -07:00 committed by GitHub
commit 38f0e611c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,7 +75,9 @@ namespace Jellyfin.Server.Migrations
var xmlSerializer = new MyXmlSerializer();
var migrationConfigPath = Path.Join(appPaths.ConfigurationDirectoryPath, MigrationsListStore.StoreKey.ToLowerInvariant() + ".xml");
var migrationOptions = (MigrationOptions)xmlSerializer.DeserializeFromFile(typeof(MigrationOptions), migrationConfigPath)!;
var migrationOptions = File.Exists(migrationConfigPath)
? (MigrationOptions)xmlSerializer.DeserializeFromFile(typeof(MigrationOptions), migrationConfigPath)!
: new MigrationOptions();
// We have to deserialize it manually since the configuration manager may overwrite it
var serverConfig = (ServerConfiguration)xmlSerializer.DeserializeFromFile(typeof(ServerConfiguration), appPaths.SystemConfigurationFilePath)!;