Fix crash on missing server config file

pull/6998/head
Joe Rogers 3 years ago
parent 38f0e611c8
commit 0f4da9f635
No known key found for this signature in database
GPG Key ID: 0074AD57B8FDBBB4

@ -80,7 +80,10 @@ namespace Jellyfin.Server.Migrations
: new MigrationOptions();
// We have to deserialize it manually since the configuration manager may overwrite it
var serverConfig = (ServerConfiguration)xmlSerializer.DeserializeFromFile(typeof(ServerConfiguration), appPaths.SystemConfigurationFilePath)!;
var serverConfig = File.Exists(appPaths.SystemConfigurationFilePath)
? (ServerConfiguration)xmlSerializer.DeserializeFromFile(typeof(ServerConfiguration), appPaths.SystemConfigurationFilePath)!
: new ServerConfiguration();
HandleStartupWizardCondition(migrations, migrationOptions, serverConfig.IsStartupWizardCompleted, logger);
PerformMigrations(migrations, migrationOptions, options => xmlSerializer.SerializeToFile(options, migrationConfigPath), logger);
}

Loading…
Cancel
Save