FIX:add protection when amsmapping popup

Change-Id: Ia68e5b14c0286f84133686b45d3d8b851b7ffd82
This commit is contained in:
tao wang 2023-04-11 15:34:59 +08:00 committed by Lane.Wei
parent 5e6cfb069a
commit 185235dd93

View file

@ -3207,7 +3207,11 @@ void SelectMachineDialog::set_default()
pos.y += item->GetRect().height;
m_mapping_popup.Move(pos);
if (obj_ && obj_->has_ams() && ams_check->GetValue()) {
if (obj_ &&
obj_->has_ams() &&
ams_check->GetValue() &&
obj_->dev_id == m_printer_last_select)
{
m_mapping_popup.set_parent_item(item);
m_mapping_popup.set_current_filament_id(extruder);
m_mapping_popup.set_tag_texture(materials[extruder]);