FIX: safe the ams_id traverse

jira: [none]
Change-Id: I58b7769f843f3dbef8b51a15768711257f590dba
(cherry picked from commit f0efb9af0d1f5df72f2b43d8ffef581d177c49a4)
This commit is contained in:
xin.zhang
2025-01-11 14:14:15 +08:00
committed by Noisyfox
parent 1a27e545a6
commit c04d50f885
3 changed files with 19 additions and 5 deletions

View File

@@ -1199,7 +1199,7 @@ bool MachineObject::need_SD_card() const
int MachineObject::get_extruder_id_by_ams_id(const std::string &ams_id)
{
if (ams_id.empty())
if (ams_id.empty() || (ams_id == "-1"))
return 0;
auto it = amsList.find(ams_id);