From de810d1eea7c23e0a84a9b2f38a525c192dfa4e0 Mon Sep 17 00:00:00 2001 From: Guillaume Meunier Date: Sun, 3 Aug 2025 14:27:00 +0200 Subject: [PATCH] Don't crash the client when the icon cannot be loaded --- client/scenes/lobby_gui.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/client/scenes/lobby_gui.cpp b/client/scenes/lobby_gui.cpp index ecb23353..0036cbe1 100644 --- a/client/scenes/lobby_gui.cpp +++ b/client/scenes/lobby_gui.cpp @@ -440,7 +440,17 @@ void scenes::lobby::gui_connected() if (std::chrono::steady_clock::now() - t0 > 10ms) 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; }