mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-17 08:11:51 +00:00
Fix startup failure on invalid games.yml
Add some exception checking/ignoring.
This commit is contained in:
parent
ee54ba970a
commit
634c4355fe
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user