diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index 7a6629c456..f4df504896 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -2989,7 +2989,18 @@ int MachineObject::parse_json(std::string payload, bool key_field_only) } } if (j_pre["print"].contains("plate_idx")){ // && m_plate_index == -1 - m_plate_index = j_pre["print"]["plate_idx"].get(); + if (j_pre["print"]["plate_idx"].is_number()) + { + m_plate_index = j_pre["print"]["plate_idx"].get(); + } + else if (j_pre["print"]["plate_idx"].is_string()) + { + try + { + m_plate_index = std::stoi(j_pre["print"]["plate_idx"].get()); + } + catch (...) { BOOST_LOG_TRIVIAL(error) << "parse_json: failed to convert plate_idx to int"; } + } } } if (j_pre.contains("system")) {