Fix crash when cancelling part type change dialog
This commit is contained in:
parent
fc9b7ed59c
commit
53e358f32c
1 changed files with 4 additions and 1 deletions
|
@ -4301,7 +4301,10 @@ void ObjectList::change_part_type()
|
|||
int selection = 0;
|
||||
if (auto it = std::find(types.begin(), types.end(), type); it != types.end())
|
||||
selection = it - types.begin();
|
||||
const auto new_type = types[wxGetApp().GetSingleChoiceIndex(_L("Type:"), _L("Select type of part"), names, selection)];
|
||||
|
||||
auto choice = wxGetApp().GetSingleChoiceIndex(_L("Type:"), _L("Select type of part"), names, selection);
|
||||
const auto new_type = choice >= 0 ? types[choice] : ModelVolumeType::INVALID;
|
||||
|
||||
if (new_type == type || new_type == ModelVolumeType::INVALID)
|
||||
return;
|
||||
|
||||
|
|
Loading…
Reference in a new issue