From 0fa9bcc63b6daee4c58d73bb726e3311c78ea66b Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Mon, 16 Jan 2023 19:47:35 +0100 Subject: [PATCH] Fix crash with fff mmu --- src/slic3r/GUI/GLCanvas3D.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 6b8499dde..291cc57ec 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -7100,9 +7100,12 @@ const ModelVolume *get_model_volume(const GLVolume &v, const Model &model) const ModelVolume * ret = nullptr; if (model.objects.size() < v.object_idx()) { - const ModelObject *obj = model.objects[v.object_idx()]; - if (obj->volumes.size() < v.volume_idx()) - ret = obj->volumes[v.volume_idx()]; + if (v.object_idx() < model.objects.size()) { + const ModelObject *obj = model.objects[v.object_idx()]; + if (v.volume_idx() < obj->volumes.size()) { + ret = obj->volumes[v.volume_idx()]; + } + } } return ret;