diff --git a/app/AppConfig.cs b/app/AppConfig.cs index fcd9f167..265ab0cd 100644 --- a/app/AppConfig.cs +++ b/app/AppConfig.cs @@ -41,10 +41,19 @@ public static class AppConfig { config = JsonSerializer.Deserialize>(text); } - catch + catch (Exception ex) { - Logger.WriteLine("Broken config: " + text); - Init(); + Logger.WriteLine($"Broken config: {ex.Message} {text}"); + try + { + text = File.ReadAllText(configFile + ".bak"); + config = JsonSerializer.Deserialize>(text); + } + catch (Exception exb) + { + Logger.WriteLine($"Broken backup config: {exb.Message} {text}"); + Init(); + } } } else