Fix dashboard crash when steam apps list does not exist

This commit is contained in:
Sapphire
2024-10-25 08:56:24 +02:00
committed by Guillaume
parent f687cfe0d0
commit 9260462e74
+16 -1
View File
@@ -54,7 +54,22 @@ std::vector<steam_app> steam_apps(const std::string & locale)
{
std::vector<steam_app> apps;
nlohmann::json json = nlohmann::json::parse(read_vr_manifest());
auto manifest = read_vr_manifest();
if (manifest.empty())
{
return apps;
}
nlohmann::json json;
try
{
json = nlohmann::json::parse(manifest);
}
catch (std::exception & e)
{
std::cerr << e.what() << std::endl;
return apps;
}
for (auto & i: json["applications"])
{