From 0cc72542100c17c2c1669e2a98376e065e5dc63d Mon Sep 17 00:00:00 2001
From: Thomas Goyne <plorkyeran@aegisub.org>
Date: Tue, 18 Mar 2014 14:03:36 -0700
Subject: [PATCH] Fix crash on startup when the config file can't be written

---
 src/frame_main.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/frame_main.cpp b/src/frame_main.cpp
index 3e8659ac6..a24a380a3 100644
--- a/src/frame_main.cpp
+++ b/src/frame_main.cpp
@@ -283,7 +283,12 @@ FrameMain::FrameMain()
 #ifdef WITH_UPDATE_CHECKER
 		int result = wxMessageBox(_("Do you want Aegisub to check for updates whenever it starts? You can still do it manually via the Help menu."),_("Check for updates?"), wxYES_NO | wxCENTER);
 		OPT_SET("App/Auto/Check For Updates")->SetBool(result == wxYES);
-		config::opt->Flush();
+		try {
+			config::opt->Flush();
+		}
+		catch (agi::fs::FileSystemError const& e) {
+			wxMessageBox(to_wx(e.GetMessage()), "Error saving config file", wxOK | wxICON_ERROR | wxCENTER);
+		}
 #endif
 	}
 
-- 
GitLab