FIX: UnsavedChangesDialog crash when handle variant_index of printer max_jerk

Change-Id: If55458531d69436cdf59bdb3deead32d319f383a
Github: 6188
This commit is contained in:
chunmao.guo 2025-03-27 14:49:55 +08:00 committed by Lane.Wei
parent cd4fcb292a
commit 3ad0d30d16
1 changed files with 2 additions and 0 deletions

View File

@ -1783,6 +1783,8 @@ void UnsavedChangesDialog::update_tree(Preset::Type type, PresetCollection* pres
} }
auto category = option.category_local; auto category = option.category_local;
if (variant_index >= 0) { if (variant_index >= 0) {
if (printer_options_with_variant_2.count(opt_key.substr(0, opt_key.find_last_of('#'))) > 0)
variant_index /= 2;
if (boost::nowide::narrow(category).find("Extruder ") == 0) if (boost::nowide::narrow(category).find("Extruder ") == 0)
category = category.substr(0, 8); category = category.substr(0, 8);
if (extruder_id) if (extruder_id)