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.
This commit is contained in:
YuSanka 2021-12-10 17:09:42 +01:00
parent baee1671ef
commit 14749d3c73

View file

@ -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) ) {