From 44d7ac44742905f79f328180b2b6c824b259decf Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Mon, 25 Nov 2019 14:42:36 +0100 Subject: [PATCH] Fixed crash when calling Reload from disk command after slicing on SLA printer --- src/slic3r/GUI/Plater.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 61a42d06a..789271581 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -3177,9 +3177,13 @@ void Plater::priv::reload_from_disk() for (unsigned int idx : selected_volumes_idxs) { const GLVolume* v = selection.get_volume(idx); - int o_idx = v->object_idx(); int v_idx = v->volume_idx(); - selected_volumes.push_back({ o_idx, v_idx }); + if (v_idx >= 0) + { + int o_idx = v->object_idx(); + if ((0 <= o_idx) && (o_idx < (int)model.objects.size())) + selected_volumes.push_back({ o_idx, v_idx }); + } } std::sort(selected_volumes.begin(), selected_volumes.end()); selected_volumes.erase(std::unique(selected_volumes.begin(), selected_volumes.end()), selected_volumes.end());