From ff2b8da8dc731854b9bceca15c71ee72054b4333 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Thu, 17 Mar 2022 11:39:58 +0100 Subject: [PATCH] Fixed crash when pressing 'Reset rotation' button while editing SLA support points (mentioned in #7359) --- src/slic3r/GUI/Gizmos/GLGizmosCommon.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmosCommon.cpp b/src/slic3r/GUI/Gizmos/GLGizmosCommon.cpp index 42bb0e58c..f1156f937 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmosCommon.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmosCommon.cpp @@ -251,7 +251,7 @@ void HollowedMesh::on_update() const GLCanvas3D* canvas = get_pool()->get_canvas(); const PrintObjects& print_objects = canvas->sla_print()->objects(); - const SLAPrintObject* print_object = m_print_object_idx != -1 + const SLAPrintObject* print_object = (m_print_object_idx >= 0 && m_print_object_idx < int(print_objects.size())) ? print_objects[m_print_object_idx] : nullptr; @@ -474,7 +474,7 @@ void SupportsClipper::on_update() const GLCanvas3D* canvas = get_pool()->get_canvas(); const PrintObjects& print_objects = canvas->sla_print()->objects(); - const SLAPrintObject* print_object = m_print_object_idx != -1 + const SLAPrintObject* print_object = (m_print_object_idx >= 0 && m_print_object_idx < int(print_objects.size())) ? print_objects[m_print_object_idx] : nullptr;