Fixed crash in Plater::priv::can_reload_from_disk()

This commit is contained in:
Enrico Turri 2019-10-10 14:44:52 +02:00
parent a65b8f462d
commit e51d970b2e

View file

@ -3835,9 +3835,9 @@ bool Plater::priv::can_reload_from_disk() const
for (unsigned int idx : selected_volumes_idxs) for (unsigned int idx : selected_volumes_idxs)
{ {
const GLVolume* v = selection.get_volume(idx); const GLVolume* v = selection.get_volume(idx);
int o_idx = v->object_idx();
int v_idx = v->volume_idx(); int v_idx = v->volume_idx();
selected_volumes.push_back({ o_idx, v_idx }); if (v_idx >= 0)
selected_volumes.push_back({ v->object_idx(), v_idx });
} }
std::sort(selected_volumes.begin(), selected_volumes.end()); std::sort(selected_volumes.begin(), selected_volumes.end());
selected_volumes.erase(std::unique(selected_volumes.begin(), selected_volumes.end()), selected_volumes.end()); selected_volumes.erase(std::unique(selected_volumes.begin(), selected_volumes.end()), selected_volumes.end());