diff --git a/rpcs3/rpcs3qt/game_list_frame.cpp b/rpcs3/rpcs3qt/game_list_frame.cpp index 1c5b94d146..da1e22f31c 100644 --- a/rpcs3/rpcs3qt/game_list_frame.cpp +++ b/rpcs3/rpcs3qt/game_list_frame.cpp @@ -532,7 +532,33 @@ void game_list_frame::Refresh(const bool fromDrive, const bool scrollAfter) add_dir(_hdd + "game/", false); add_dir(_hdd + "disc/", true); - for (auto pair : YAML::Load(fs::file{fs::get_config_dir() + "/games.yml", fs::read + fs::create}.to_string())) + auto get_games = []() -> YAML::Node + { + try + { + fs::file games(fs::get_config_dir() + "/games.yml", fs::read + fs::create); + + if (games) + { + return YAML::Load(games.to_string()); + } + else + { + game_list_log.error("Failed to load games.yml, check permissions."); + return {}; + } + } + catch (...) + { + // YAML exception aren't very useful so just ignore them + game_list_log.fatal("Failed to parse games.yml"); + return {}; + } + + return {}; + }; + + for (auto&& pair : get_games()) { std::string game_dir = pair.second.Scalar();