From 8407c409d9d16e3ee009dc8cd5963382606b9a1d Mon Sep 17 00:00:00 2001 From: "zhimin.zeng" Date: Thu, 7 Sep 2023 18:40:20 +0800 Subject: [PATCH] FIX: crash when switch device page to cali page Jira: 4358 Change-Id: Ic4d23bd7e31c7419516a3ab55a4d9a2e2072cd47 --- src/slic3r/GUI/CalibrationWizardPresetPage.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/CalibrationWizardPresetPage.cpp b/src/slic3r/GUI/CalibrationWizardPresetPage.cpp index eac53d08e..a760f6b25 100644 --- a/src/slic3r/GUI/CalibrationWizardPresetPage.cpp +++ b/src/slic3r/GUI/CalibrationWizardPresetPage.cpp @@ -1527,8 +1527,11 @@ void CalibrationPresetPage::set_cali_method(CalibrationMethod method) m_custom_range_panel->set_titles(titles); wxArrayString values; + ExtruderType extruder_type = ExtruderType::etDirectDrive; Preset* printer_preset = get_printer_preset(curr_obj, get_nozzle_value()); - int extruder_type = printer_preset->config.opt_enum("extruder_type", 0); + if (printer_preset) { + extruder_type = ExtruderType(printer_preset->config.opt_enum("extruder_type", 0)); + } if (extruder_type == ExtruderType::etBowden) { values.push_back(_L("0")); values.push_back(_L("0.5"));