Skip to content

Commit

Permalink
Fix preset transfer crash (#8744)
Browse files Browse the repository at this point in the history
Fix preset transfer crash (#7991)
  • Loading branch information
Noisyfox authored Mar 7, 2025
1 parent bc698a8 commit 1d71ed5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/slic3r/GUI/UnsavedChangesDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2383,13 +2383,17 @@ void DiffPresetDialog::button_event(Action act)

std::string DiffPresetDialog::get_left_preset_name(Preset::Type type)
{
PresetComboBox* cb = m_preset_combos[int(type - Preset::TYPE_PRINT)].presets_left;
PresetComboBox* cb = std::find_if(m_preset_combos.begin(), m_preset_combos.end(), [type](const DiffPresets& p) {
return p.presets_left->get_type() == type;
})->presets_left;
return Preset::remove_suffix_modified(get_selection(cb));
}

std::string DiffPresetDialog::get_right_preset_name(Preset::Type type)
{
PresetComboBox* cb = m_preset_combos[int(type - Preset::TYPE_PRINT)].presets_right;
PresetComboBox* cb = std::find_if(m_preset_combos.begin(), m_preset_combos.end(), [type](const DiffPresets& p) {
return p.presets_right->get_type() == type;
})->presets_right;
return Preset::remove_suffix_modified(get_selection(cb));
}

Expand Down

0 comments on commit 1d71ed5

Please sign in to comment.