mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-02-23 21:05:31 -07:00
Fix potential crash during calib
This commit is contained in:
parent
57e5f5c4c4
commit
aac6e2a3d0
1 changed files with 12 additions and 6 deletions
|
|
@ -4481,8 +4481,10 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
|
|||
} else if (jj["command"].get<std::string>() == "ams_filament_setting" && !key_field_only) {
|
||||
if (jj.contains("result") && jj.contains("reason")) {
|
||||
if (jj["result"].get<std::string>() == "fail") {
|
||||
auto err_code = jj["err_code"].get<int>();
|
||||
print_error = err_code;
|
||||
if (jj.contains("err_code")) {
|
||||
auto err_code = jj["err_code"].get<int>();
|
||||
print_error = err_code;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4622,8 +4624,10 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
|
|||
} else if (jj["command"].get<std::string>() == "extrusion_cali_set") {
|
||||
if (jj.contains("result") && jj.contains("reason")) {
|
||||
if (jj["result"].get<std::string>() == "fail") {
|
||||
auto err_code = jj["err_code"].get<int>();
|
||||
print_error = err_code;
|
||||
if (jj.contains("err_code")) {
|
||||
auto err_code = jj["err_code"].get<int>();
|
||||
print_error = err_code;
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef CALI_DEBUG
|
||||
|
|
@ -4672,8 +4676,10 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
|
|||
else if (jj["command"].get<std::string>() == "extrusion_cali_sel") {
|
||||
if (jj.contains("result") && jj.contains("reason")) {
|
||||
if (jj["result"].get<std::string>() == "fail") {
|
||||
auto err_code = jj["err_code"].get<int>();
|
||||
print_error = err_code;
|
||||
if (jj.contains("err_code")) {
|
||||
auto err_code = jj["err_code"].get<int>();
|
||||
print_error = err_code;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue