From 81cebe5be3903e3cdcaa75f689dbdffaf7891b21 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Mon, 3 Apr 2023 10:48:59 +0200 Subject: [PATCH] SPE-1629 - Fixed crash at startup when any of the svg files used as icon into imgui dialog is renamed/removed. --- src/slic3r/GUI/ImGuiWrapper.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/slic3r/GUI/ImGuiWrapper.cpp b/src/slic3r/GUI/ImGuiWrapper.cpp index 55bf576028..73a4cc439e 100644 --- a/src/slic3r/GUI/ImGuiWrapper.cpp +++ b/src/slic3r/GUI/ImGuiWrapper.cpp @@ -1700,6 +1700,10 @@ void ImGuiWrapper::init_font(bool compress) assert(rect->Width == icon_sz); assert(rect->Height == icon_sz); std::vector raw_data = load_svg(icon.second, icon_sz, icon_sz); + if (raw_data.empty()) { + rect_id++; + continue; + } const ImU32* pIn = (ImU32*)raw_data.data(); for (int y = 0; y < icon_sz; y++) { ImU32* pOut = (ImU32*)pixels + (rect->Y + y) * width + (rect->X);