From 2916c61ec6573f29b6efc6f979787b8f57b8e1e4 Mon Sep 17 00:00:00 2001 From: cathery Date: Tue, 7 Jan 2020 05:49:20 +0300 Subject: [PATCH] Relax config.json parsing restrictions Sysmodules menu no longer fails if it can't parse the file --- source/gui/gui_sysmodule.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/source/gui/gui_sysmodule.cpp b/source/gui/gui_sysmodule.cpp index 73aba98..e2fda83 100644 --- a/source/gui/gui_sysmodule.cpp +++ b/source/gui/gui_sysmodule.cpp @@ -35,17 +35,12 @@ GuiSysmodule::GuiSysmodule() : Gui() { anyModulesPresent = false; std::ifstream configFile("sdmc:/switch/KosmosToolbox/config.json"); - - if (configFile.fail()) { - Gui::g_nextGui = GUI_MAIN; - return; - } - json configJson; - try { - configFile >> configJson; - } catch(json::parse_error& e) { - return; + + if (!configFile.fail()) { + try { + configFile >> configJson; + } catch(json::parse_error& e) {} } DIR *contents_dir = opendir(CONTENTS_PATH);