From 09df1248c032523f1f1c10adb0163084acf8af26 Mon Sep 17 00:00:00 2001 From: "chunmao.guo" Date: Fri, 14 Feb 2025 22:40:15 +0800 Subject: [PATCH] FIX: diff preset crash with diff extruder count Change-Id: Ifeb8f0aa1ff62aac663a6cc007da675af4d027fc Jira: STUDIO-10458 (cherry picked from commit af880399a50da2ae881347461965ec3876b61d52) --- src/slic3r/GUI/UnsavedChangesDialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/UnsavedChangesDialog.cpp b/src/slic3r/GUI/UnsavedChangesDialog.cpp index 86efbdb439..e04292f4db 100644 --- a/src/slic3r/GUI/UnsavedChangesDialog.cpp +++ b/src/slic3r/GUI/UnsavedChangesDialog.cpp @@ -1287,7 +1287,7 @@ static wxString get_string_value(std::string opt_key, const DynamicPrintConfig& } else { auto values = config.opt(opt_key); - if (opt_idx < values->size()) + if (values && opt_idx < values->size()) return double_to_string(values->get_at(opt_idx)); } return _L("Undef"); @@ -2214,7 +2214,7 @@ void DiffPresetDialog::update_tree() wxString left_val = from_u8((boost::format("%1%") % left_config.opt("extruder_colour")->values.size()).str()); wxString right_val = from_u8((boost::format("%1%") % right_congig.opt("extruder_colour")->values.size()).str()); - m_tree->Append("extruders_count", type, "General", "Capabilities", local_label, left_val, right_val, category_icon_map.at("General")); + m_tree->Append("extruders_count", type, "General", "Capabilities", local_label, left_val, right_val, category_icon_map.at("Basic information")); } for (const std::string& opt_key : dirty_options) {