mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-25 09:14:29 +08:00
Fix crash when cancelling part type change dialog
This commit is contained in:
parent
fc9b7ed59c
commit
53e358f32c
@ -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…
x
Reference in New Issue
Block a user