FIX: crash when switch device page to cali page

Jira: 4358
Change-Id: Ic4d23bd7e31c7419516a3ab55a4d9a2e2072cd47
This commit is contained in:
zhimin.zeng 2023-09-07 18:40:20 +08:00 committed by Lane.Wei
parent 9e0953f468
commit 8407c409d9
1 changed files with 4 additions and 1 deletions

View File

@ -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"));