Fix send dialog crash for a single-nozzle plate on a two-extruder printer (#16599)

update_material_item_pos() chose the left or right nozzle panel from the printer alone and then read m_filaments_map, which reset_and_sync_ams_list() fills only for a multi-nozzle plate. Clicking Print plate with a plate sliced for one nozzle (A1) and a two-extruder printer selected (X2D) read the empty map and crashed. For a single-nozzle plate the dialog now uses the single panel.
This commit is contained in:
Florian Benkö authored and GitHub committed 2026-10-19 20:52:15 -05:00
1 parent 6bff3c3cd6
commit c9d897b4d0
1 file changed
+7 -3
+7 -3
View File
@@ -5738,8 +5738,9 @@ void SelectMachineDialog::reset_and_sync_ams_list()
}
// Orca: collapse the per-nozzle material items into the single panel when the printer has one
// extruder or a filament switch (both feed a single logical mapping surface); otherwise keep the
// left/right split. Early-returns unless an item is actually in the wrong panel.
// extruder or a filament switch (both feed a single logical mapping surface), or when the plate is
// sliced for one nozzle (it has no left/right filament map); otherwise keep the left/right split.
// Early-returns unless an item is actually in the wrong panel.
void SelectMachineDialog::update_material_item_pos(MachineObject* obj_)
{
if (!obj_) {
@@ -5748,7 +5749,10 @@ void SelectMachineDialog::update_material_item_pos(MachineObject* obj_)
const bool is_single_head = obj_->GetExtderSystem()->GetTotalExtderCount() < 2;
const bool has_switcher = obj_->GetFilaSwitch()->IsInstalled();
const bool use_single_panel = is_single_head || has_switcher;
// reset_and_sync_ams_list() fills m_filaments_map only for a multi-nozzle plate
const auto& full_config = wxGetApp().preset_bundle->full_config();
const bool single_nozzle_plate = full_config.option<ConfigOptionFloats>("nozzle_diameter")->values.size() < 2;
const bool use_single_panel = is_single_head || has_switcher || single_nozzle_plate;
bool to_change_pos = false;
for (const auto& iter : m_materialList) {