From 121b0f9a604503b777f6b2de1dc59fb65ea3333a Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Mon, 24 Oct 2022 14:07:56 +0200 Subject: [PATCH] Measuring - Gizmo measure - Fixed crash when creating a new project using CTRL+N while the gizmo is active --- src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp b/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp index 14caa193de..86fa9ff5c3 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp @@ -835,7 +835,11 @@ void GLGizmoMeasure::update_if_needed() m_old_model_volume = volume; }; - m_volume_matrix = m_parent.get_selection().get_first_volume()->world_matrix(); + const Selection& selection = m_parent.get_selection(); + if (selection.is_empty()) + return; + + m_volume_matrix = selection.get_first_volume()->world_matrix(); const ModelObject* mo = m_c->selection_info()->model_object(); const ModelVolume* mv = m_c->selection_info()->model_volume();