Added checks and try-catch when attempting to load icons

Fixes #437
This commit is contained in:
Guillaume Meunier
2025-08-09 10:12:58 +02:00
parent b036731b51
commit d5ef8c1a85
2 changed files with 299 additions and 304 deletions
+12 -5
View File
@@ -757,12 +757,19 @@ void wivrn_session::operator()(from_headset::get_application_list && request)
{
if (app.icon_path)
{
auto icon = load_icon(*app.icon_path, 256);
try
{
auto icon = load_icon(*app.icon_path, 256);
send_control(to_headset::application_icon{
.id = id,
.image = std::move(icon),
});
send_control(to_headset::application_icon{
.id = id,
.image = std::move(icon),
});
}
catch (std::exception & e)
{
U_LOG_W("Error loading icon %s: %s", app.icon_path->c_str(), e.what());
}
}
}
}