mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-12-27 09:59:48 -07:00
FIX: crash when sending print with empty ams_id
jira: none Change-Id: I89dc87af28b45c69eac86810444de2519dfccd08 (cherry picked from commit f53e00ec6d9350046df4b9dc70cec75039b6d5d1)
This commit is contained in:
parent
72fa3fbb26
commit
2db5cae51f
1 changed files with 8 additions and 2 deletions
|
|
@ -2038,8 +2038,14 @@ bool SelectMachineDialog::get_ams_mapping_result(std::string &mapping_array_str,
|
|||
|
||||
try
|
||||
{
|
||||
mapping_item_v1["ams_id"] = std::stoi(m_ams_mapping_result[k].ams_id);
|
||||
mapping_item_v1["slot_id"] = std::stoi(m_ams_mapping_result[k].slot_id);
|
||||
if (m_ams_mapping_result[k].ams_id.empty() || m_ams_mapping_result[k].slot_id.empty()) { // invalid case
|
||||
mapping_item_v1["ams_id"] = VIRTUAL_TRAY_ID;
|
||||
mapping_item_v1["slot_id"] = VIRTUAL_TRAY_ID;
|
||||
}
|
||||
else {
|
||||
mapping_item_v1["ams_id"] = std::stoi(m_ams_mapping_result[k].ams_id);
|
||||
mapping_item_v1["slot_id"] = std::stoi(m_ams_mapping_result[k].slot_id);
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue