mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 02:22:17 +00:00
FIX: fix crash when cannot find preset
jira: STUDIO-9422 Change-Id: If81e1ac9379ccbc4b40cbda5cf8cb876ea230173 (cherry picked from commit 758d37d0807288cf63fa2b7487a65d7097b94e8e)
This commit is contained in:
@@ -1507,6 +1507,8 @@ void CalibrationPresetPage::update_combobox_filaments(MachineObject* obj)
|
||||
}
|
||||
|
||||
Preset* printer_preset = get_printer_preset(obj, nozzle_value);
|
||||
if (!printer_preset)
|
||||
return;
|
||||
|
||||
auto opt_extruder_type = printer_preset->config.option<ConfigOptionEnumsGeneric>("extruder_type");
|
||||
if (opt_extruder_type) {
|
||||
|
||||
@@ -1107,6 +1107,9 @@ bool Sidebar::priv::sync_extruder_list()
|
||||
PresetBundle *preset_bundle = wxGetApp().preset_bundle;
|
||||
std::string target_model_id = preset_bundle->printers.get_selected_preset().get_printer_type(preset_bundle);
|
||||
Preset* machine_preset = get_printer_preset(obj);
|
||||
if (!machine_preset)
|
||||
return false;
|
||||
|
||||
if (machine_print_name != target_model_id) {
|
||||
MessageDialog dlg(this->plater, _L("The currently selected machine preset is inconsistent with the connected printer type.\n"
|
||||
"Are you sure to continue syncing?"), _L("Sync extruder infomation"), wxICON_WARNING | wxYES | wxNO);
|
||||
|
||||
Reference in New Issue
Block a user