Fixed crash when pressing 'Reset rotation' button while editing SLA support points (mentioned in #7359)

This commit is contained in:
Lukas Matena 2022-03-17 11:39:58 +01:00
parent 5de93c8784
commit ff2b8da8dc

View File

@ -251,7 +251,7 @@ void HollowedMesh::on_update()
const GLCanvas3D* canvas = get_pool()->get_canvas(); const GLCanvas3D* canvas = get_pool()->get_canvas();
const PrintObjects& print_objects = canvas->sla_print()->objects(); 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] ? print_objects[m_print_object_idx]
: nullptr; : nullptr;
@ -474,7 +474,7 @@ void SupportsClipper::on_update()
const GLCanvas3D* canvas = get_pool()->get_canvas(); const GLCanvas3D* canvas = get_pool()->get_canvas();
const PrintObjects& print_objects = canvas->sla_print()->objects(); 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] ? print_objects[m_print_object_idx]
: nullptr; : nullptr;