From 3ad0d30d1604cc658dd2098b6dc88e0e3eec2911 Mon Sep 17 00:00:00 2001 From: "chunmao.guo" Date: Thu, 27 Mar 2025 14:49:55 +0800 Subject: [PATCH] FIX: UnsavedChangesDialog crash when handle variant_index of printer max_jerk Change-Id: If55458531d69436cdf59bdb3deead32d319f383a Github: 6188 --- src/slic3r/GUI/UnsavedChangesDialog.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/slic3r/GUI/UnsavedChangesDialog.cpp b/src/slic3r/GUI/UnsavedChangesDialog.cpp index 6bb333076..ecd4b13b1 100644 --- a/src/slic3r/GUI/UnsavedChangesDialog.cpp +++ b/src/slic3r/GUI/UnsavedChangesDialog.cpp @@ -1783,6 +1783,8 @@ void UnsavedChangesDialog::update_tree(Preset::Type type, PresetCollection* pres } auto category = option.category_local; 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) category = category.substr(0, 8); if (extruder_id)