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());