From f27a713aaf77b1109fc57b8650efa6b23081f799 Mon Sep 17 00:00:00 2001 From: "zhou.xu" Date: Thu, 10 Oct 2024 14:35:11 +0800 Subject: [PATCH] FIX:add protection for null pointer jira: none Change-Id: I9a9231bab893f5d2afa008f65165269ae176c962 --- src/slic3r/GUI/Gizmos/GLGizmoRotate.cpp | 4 ++++ src/slic3r/GUI/Gizmos/GLGizmoSVG.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoRotate.cpp b/src/slic3r/GUI/Gizmos/GLGizmoRotate.cpp index e8aa86612..264903f94 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoRotate.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoRotate.cpp @@ -496,6 +496,10 @@ void GLGizmoRotate3D::on_set_state() void GLGizmoRotate3D::data_changed(bool is_serializing) { const Selection &selection = m_parent.get_selection(); const GLVolume * volume = selection.get_first_volume(); + if (volume == nullptr) { + m_last_volume = nullptr; + return; + } if (m_last_volume != volume) { m_last_volume = volume; Geometry::Transformation tran; diff --git a/src/slic3r/GUI/Gizmos/GLGizmoSVG.cpp b/src/slic3r/GUI/Gizmos/GLGizmoSVG.cpp index d64870bd9..e12e4e562 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoSVG.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoSVG.cpp @@ -1500,7 +1500,7 @@ void GLGizmoSVG::draw_filename() draw(get_icon(m_icons, IconType::bake, IconState::hovered)); ImGui::SameLine(); // TRN: An menu option to convert the SVG into an unmodifiable model part. - if (ImGui::Selectable(_L("Bake to model").c_str())) { + if (ImGui::Selectable(_u8L("Bake to model").c_str())) { m_volume->emboss_shape.reset(); close(); } else if (ImGui::IsItemHovered()) {