diff --git a/source/ChanSort/MainForm.cs b/source/ChanSort/MainForm.cs index 7cb1561..0bacc46 100644 --- a/source/ChanSort/MainForm.cs +++ b/source/ChanSort/MainForm.cs @@ -2516,10 +2516,17 @@ namespace ChanSort.Ui private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { - if (this.PromptSaveAndContinue()) - this.SaveSettings(); - else - e.Cancel = true; + try + { + if (this.PromptSaveAndContinue()) + this.SaveSettings(); + else + e.Cancel = true; + } + catch + { + // ignore - always allow to exit + } } #endregion diff --git a/source/ChanSort/Properties/Config.cs b/source/ChanSort/Properties/Config.cs index 4a3ad10..6c32079 100644 --- a/source/ChanSort/Properties/Config.cs +++ b/source/ChanSort/Properties/Config.cs @@ -57,6 +57,9 @@ namespace ChanSort.Ui.Properties public void Save() { + var folder = Path.GetDirectoryName(ConfigFilePath); + Directory.CreateDirectory(folder); + using (var stream = new FileStream(ConfigFilePath, FileMode.Create)) using (var writer = new StreamWriter(stream, System.Text.Encoding.UTF8)) { diff --git a/source/changelog.md b/source/changelog.md index c1e27ff..dd4b574 100644 --- a/source/changelog.md +++ b/source/changelog.md @@ -1,6 +1,9 @@ ChanSort Change Log =================== +2019-07-25 +- fix: Application failed to save config and didn't exit when the folder %LOCALAPPDATA%\ChanSort doesn't exist + 2019-07-20 - user settings are now persisted across releases in %LOCALAPPDATA%\ChanSort\config.xml - fixed Sony sdb.xml DVB-T channel lists