diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index fd79cbda0..183af3489 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -4958,28 +4958,35 @@ bool SelectMachineDialog::Show(bool show) { show_status(PrintDialogStatus::PrintStatusInit); - const ConfigOptionDef* bed_type_def = print_config_def.get("curr_bed_type"); PresetBundle& preset_bundle = *wxGetApp().preset_bundle; auto cur_preset_name = preset_bundle.printers.get_edited_preset().name; - auto name = wxGetApp().app_config->get_section("user_bed_type_list"); - std::string plate_name = ""; - for (auto it : name) { - if (it.first == cur_preset_name) { - plate_name = it.second; - break; - } - } - if (bed_type_def != nullptr){ - for (auto it : bed_type_def->enum_labels) { - if (it.find(plate_name) != std::string::npos) { - plate_name = it; + + if (wxGetApp().app_config->has_section("user_bed_type_list")) { + std::string plate_name = ""; + auto name = wxGetApp().app_config->get_section("user_bed_type_list"); + for (auto it : name) { + if (it.first == cur_preset_name) { + plate_name = it.second; break; } } + const ConfigOptionDef* bed_type_def = print_config_def.get("curr_bed_type"); + if (bed_type_def != nullptr) { + for (auto it : bed_type_def->enum_labels) { + if (it.find(plate_name) != std::string::npos) { + plate_name = it; + break; + } + } + } + plate_name = "Plate: " + plate_name; + m_text_bed_type->SetLabelText(plate_name); + m_text_bed_type->Show(); + } + else{ + m_text_bed_type->Hide(); } - plate_name = "Plate: " + plate_name; - m_text_bed_type->SetLabelText(plate_name); // set default value when show this dialog if (show) {