mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 18:00:17 +02:00
Don't set up RootFS folder or inotify thread on config load failure
Can happen in the case that the default file tries to get loaded and doens't exist
This commit is contained in:
1 parent
1adf518e6f
commit
59df3d13cc
1 file changed
+7
-5
@@ -56,15 +56,16 @@ namespace {
|
||||
MsgTimerStart = std::chrono::high_resolution_clock::now();
|
||||
}
|
||||
|
||||
void OpenFile(std::string Filename) {
|
||||
bool OpenFile(std::string Filename) {
|
||||
if (!std::filesystem::exists(Filename)) {
|
||||
OpenMsgMessagePopup("Couldn't open: " + Filename);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
ConfigOpen = true;
|
||||
ConfigFilename = Filename;
|
||||
LoadedConfig = std::make_unique<FEX::Config::MainLoader>(Filename);
|
||||
LoadedConfig->Load();
|
||||
return true;
|
||||
}
|
||||
|
||||
void LoadNamedRootFSFolder() {
|
||||
@@ -604,9 +605,10 @@ namespace {
|
||||
}
|
||||
if (Selected.OpenDefault ||
|
||||
(ImGui::IsKeyPressed(SDL_SCANCODE_O) && io.KeyCtrl && io.KeyShift)) {
|
||||
OpenFile(FEXCore::Config::GetConfigFileLocation());
|
||||
LoadNamedRootFSFolder();
|
||||
SetupINotify();
|
||||
if (OpenFile(FEXCore::Config::GetConfigFileLocation())) {
|
||||
LoadNamedRootFSFolder();
|
||||
SetupINotify();
|
||||
}
|
||||
}
|
||||
if (Selected.LoadDefault ||
|
||||
(ImGui::IsKeyPressed(SDL_SCANCODE_D) && io.KeyCtrl && io.KeyShift)) {
|
||||
|
||||
Reference in new issue
Block a user