mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-16 02:18:54 -07:00
Merge pull request #6998 from 1337joe/dont-crash-on-missing-server-config
Fix crash on missing server config file
This commit is contained in:
commit
ec9cff29df
@ -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…
Reference in New Issue
Block a user