diff --git a/xs/src/slic3r/GUI/ConfigWizard.cpp b/xs/src/slic3r/GUI/ConfigWizard.cpp index 9f736ded8..bd9b9328a 100644 --- a/xs/src/slic3r/GUI/ConfigWizard.cpp +++ b/xs/src/slic3r/GUI/ConfigWizard.cpp @@ -409,11 +409,10 @@ PageFirmware::PageFirmware(ConfigWizard *parent) : void PageFirmware::apply_custom_config(DynamicPrintConfig &config) { - ConfigOptionEnum opt; - auto sel = gcode_picker->GetSelection(); - if (sel != wxNOT_FOUND && opt.deserialize(gcode_picker->GetString(sel).ToStdString())) { - config.set_key_value("gcode_flavor", &opt); + if (sel >= 0 && sel < gcode_opt.enum_labels.size()) { + auto *opt = new ConfigOptionEnum(static_cast(sel)); + config.set_key_value("gcode_flavor", opt); } }