Don't crash the client when the icon cannot be loaded
This commit is contained in:
committed by
Patrick Nicolas
parent
06240858fd
commit
de810d1eea
@@ -440,7 +440,17 @@ void scenes::lobby::gui_connected()
|
|||||||
if (std::chrono::steady_clock::now() - t0 > 10ms)
|
if (std::chrono::steady_clock::now() - t0 > 10ms)
|
||||||
return default_icon;
|
return default_icon;
|
||||||
|
|
||||||
it = app_icons.emplace(app.id, imgui_ctx->load_texture(app.image)).first;
|
try
|
||||||
|
{
|
||||||
|
it = app_icons.emplace(app.id, imgui_ctx->load_texture(app.image)).first;
|
||||||
|
}
|
||||||
|
catch (std::exception & e)
|
||||||
|
{
|
||||||
|
spdlog::warn("Unable to load icon for \"{}\": {}", app.id, e.what());
|
||||||
|
|
||||||
|
app.image.clear();
|
||||||
|
return default_icon;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return it->second;
|
return it->second;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user