From e116181c073ae4d8cd7c281b9114032307b66cde Mon Sep 17 00:00:00 2001 From: SoftFever Date: Wed, 15 Jul 2026 17:54:39 +0800 Subject: [PATCH] Use one agent id in switch_printer_agent and restore the preset_bundle guard Merge-resolution cleanup. The #12506 re-select path kept main's preset_bundle null check, and both select_machine calls now use effective_agent_id rather than mixing it with the equal-but-differently-named agent_info.id. --- src/slic3r/GUI/GUI_App.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 17d80cc7e5..7cdd832da5 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -3756,7 +3756,7 @@ void GUI_App::switch_printer_agent() // point at the previously active printer preset. Re-select the machine when the new // preset targets a different host, otherwise filament sync keeps hitting the old // printer. (#12506) - if (effective_agent_id != BBL_PRINTER_AGENT_ID && m_device_manager) { + if (effective_agent_id != BBL_PRINTER_AGENT_ID && m_device_manager && preset_bundle) { const std::string print_host = config.opt_string("print_host"); if (!print_host.empty()) { const std::string dev_id = MachineObject::dev_id_from_address(print_host, config.opt_string("printhost_port")); @@ -3778,7 +3778,7 @@ void GUI_App::switch_printer_agent() m_agent->start_discovery(true, false); // Auto-switch MachineObject (new agent has empty device_info, so always re-select) - select_machine(agent_info.id); + select_machine(effective_agent_id); } void GUI_App::select_machine(const std::string& agent_id)