diff --git a/Directory.Build.props b/Directory.Build.props index 1ac08a7a..2632c039 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 0.10.0 + 0.10.1 net8.0 enable latest diff --git a/src/ClientCommon/Config/ConfigProvider.cs b/src/ClientCommon/Config/ConfigProvider.cs index b22927c3..053d7f45 100644 --- a/src/ClientCommon/Config/ConfigProvider.cs +++ b/src/ClientCommon/Config/ConfigProvider.cs @@ -254,23 +254,33 @@ private void ConvertOldConfig() _dbContext.Settings.Add(new() { Name = nameof(config.SkipStartup), Value = config.SkipStartup.ToString() }); _dbContext.Settings.Add(new() { Name = nameof(config.UseLocalApi), Value = config.UseLocalApi.ToString() }); - _dbContext.Settings.Add(new() { Name = nameof(config.ApiPassword), Value = config.ApiPassword }); + _dbContext.Settings.Add(new() { Name = nameof(config.ApiPassword), Value = config.ApiPassword ?? string.Empty }); - foreach (var addon in config.Upvotes) + if (config.Upvotes is not null) { - _dbContext.Scores.Add(new() { AddonId = addon.Key, IsUpvoted = addon.Value }); + foreach (var addon in config.Upvotes) + { + _dbContext.Scores.Add(new() { AddonId = addon.Key, IsUpvoted = addon.Value }); + } } - foreach (var addon in config.DisabledAutoloadMods) + if (config.DisabledAutoloadMods is not null) { - _dbContext.DisabledAddons.Add(new() { AddonId = addon }); + foreach (var addon in config.DisabledAutoloadMods) + { + _dbContext.DisabledAddons.Add(new() { AddonId = addon }); + } } - foreach (var addon in config.Playtimes) + if (config.Playtimes is not null) { - _dbContext.Playtimes.Add(new() { AddonId = addon.Key, Playtime = addon.Value }); + foreach (var addon in config.Playtimes) + { + _dbContext.Playtimes.Add(new() { AddonId = addon.Key, Playtime = addon.Value }); + } } + _dbContext.GamePaths.Add(new() { Game = "PathDuke3D", Path = config.GamePathDuke3D }); _dbContext.GamePaths.Add(new() { Game = "PathDukeWT", Path = config.GamePathDukeWT }); _dbContext.GamePaths.Add(new() { Game = "PathDuke64", Path = config.GamePathDuke64 });