diff options
author | YuSanka <yusanka@gmail.com> | 2021-12-10 19:09:42 +0300 |
---|---|---|
committer | YuSanka <yusanka@gmail.com> | 2021-12-10 19:10:09 +0300 |
commit | 14749d3c73e92410f1d11eef9b0bfb9849d5c7df (patch) | |
tree | 5f1faa17b4f9632ba05671af2875c3d7c4a8d682 /src | |
parent | baee1671efea64be615988e9958b8d4ce3077eef (diff) |
Code refactoring for ObjectList::get_selection_indexes().
Assert is changed to check if selection isn't empty.
Elsewhere processing of the empty selection can causes a crash.
Diffstat (limited to 'src')
-rw-r--r-- | src/slic3r/GUI/GUI_ObjectList.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 5f5caa80f..908d9f84b 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -349,7 +349,8 @@ void ObjectList::get_selection_indexes(std::vector<int>& obj_idxs, std::vector<i { wxDataViewItemArray sels; GetSelections(sels); - assert(!sels.IsEmpty()); + if (sels.IsEmpty()) + return; if ( m_objects_model->GetItemType(sels[0]) & itVolume || (sels.Count()==1 && m_objects_model->GetItemType(m_objects_model->GetParent(sels[0])) & itVolume) ) { |