FIX: fix crash bug when switch preset

Change-Id: I16b33af05bdaeb0261920d00b632b517f6fe857b
(cherry picked from commit 75b1c1fb9950d3031870af912919ef86d19e420b)
This commit is contained in:
zhimin.zeng 2022-12-05 14:21:00 +08:00 committed by Lane.Wei
parent 7b82a5010a
commit 7c2417d1f8
1 changed files with 3 additions and 0 deletions

View File

@ -1666,6 +1666,9 @@ bool UnsavedChangesDialog::check_option_valid()
if (itor != m_presetitems.end()) {
PresetBundle *preset_bundle = wxGetApp().preset_bundle;
Preset * new_preset = preset_bundle->printers.find_preset(m_new_selected_preset_name);
if (new_preset == nullptr)
return false;
std::string str_print_type = new_preset->get_current_printer_type(preset_bundle);
if (str_print_type == "C11" && itor->new_value.ToStdString() == "Smooth") {
MessageDialog dlg(wxGetApp().plater(), _L("The P1P printer does not support smooth timelapse, use traditional timelapse instead."),