From ec2412ddec0fd9d21a004f231154bec28d3107f8 Mon Sep 17 00:00:00 2001 From: "xin.zhang" Date: Mon, 6 Jan 2025 17:45:52 +0800 Subject: [PATCH] FIX: fix the json assert jira: none Change-Id: I0d17ef2e8474e84397c92ecd7868c6313bb8c9f7 --- src/slic3r/GUI/DeviceManager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index 2fd4fbab3..646f6c276 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -3195,7 +3195,8 @@ int MachineObject::parse_json(std::string payload, bool key_field_only) for (auto it = j_module.begin(); it != j_module.end(); it++) { ModuleVersionInfo ver_info; ver_info.name = (*it)["name"].get(); - ver_info.product_name = wxString::FromUTF8((*it).value("product_name", json()).get()); + if ((*it).contains("product_name")) + ver_info.product_name = wxString::FromUTF8((*it)["product_name"].get()); if ((*it).contains("sw_ver")) ver_info.sw_ver = (*it)["sw_ver"].get(); if ((*it).contains("sw_new_ver"))