From 8a2c15ad606a42732d992fea66ae2fb8a483d119 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Sat, 4 Dec 2021 10:05:00 +0100 Subject: [PATCH] Fix for #7408 - Crash after closing error for deleting box shape with cylinder negative volume --- src/slic3r/GUI/Plater.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index c721419a4..dd1ccb91f 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -1260,7 +1260,11 @@ void Sidebar::show_info_sizer() if (selection.is_single_volume()) { std::vector obj_idxs, vol_idxs; wxGetApp().obj_list()->get_selection_indexes(obj_idxs, vol_idxs); - assert(vol_idxs.size() == 1); + if (vol_idxs.size() != 1) + // Case when this fuction is called between update selection in ObjectList and on Canvas + // Like after try to delete last solid part in object, the object is selected in ObjectLIst when just a part is still selected on Canvas + // see https://github.com/prusa3d/PrusaSlicer/issues/7408 + return; vol = model_object->volumes[vol_idxs[0]]; t = model_object->instances[inst_idx]->get_matrix() * vol->get_matrix(); }