mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 07:34:03 -06:00
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:
parent
baee1671ef
commit
14749d3c73
1 changed files with 2 additions and 1 deletions
|
@ -349,7 +349,8 @@ void ObjectList::get_selection_indexes(std::vector<int>& obj_idxs, std::vector<i
|
||||||
{
|
{
|
||||||
wxDataViewItemArray sels;
|
wxDataViewItemArray sels;
|
||||||
GetSelections(sels);
|
GetSelections(sels);
|
||||||
assert(!sels.IsEmpty());
|
if (sels.IsEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
if ( m_objects_model->GetItemType(sels[0]) & itVolume ||
|
if ( m_objects_model->GetItemType(sels[0]) & itVolume ||
|
||||||
(sels.Count()==1 && m_objects_model->GetItemType(m_objects_model->GetParent(sels[0])) & itVolume) ) {
|
(sels.Count()==1 && m_objects_model->GetItemType(m_objects_model->GetParent(sels[0])) & itVolume) ) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue