Skip to content

Commit

Permalink
Fixed a crash when deleting the last object with autocenter enabled (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmatena committed Nov 14, 2023
1 parent 7522d7f commit 926af1a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/slic3r/GUI/GUI_ObjectList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2473,7 +2473,9 @@ bool ObjectList::has_selected_cut_object() const

for (wxDataViewItem item : sels) {
const int obj_idx = m_objects_model->GetObjectIdByItem(item);
if (obj_idx >= 0 && object(obj_idx)->is_cut())
// ys_FIXME: The obj_idx<size condition is a workaround for https://github.com/prusa3d/PrusaSlicer/issues/11186,
// but not the correct fix. The deleted item probably should not be in sels in the first place.
if (obj_idx >= 0 && obj_idx < int(m_objects->size()) && object(obj_idx)->is_cut())
return true;
}

Expand Down

0 comments on commit 926af1a

Please sign in to comment.