FIX: fix the json assert

jira: none
Change-Id: I0d17ef2e8474e84397c92ecd7868c6313bb8c9f7
(cherry picked from commit ec2412ddec0fd9d21a004f231154bec28d3107f8)
This commit is contained in:
xin.zhang
2025-01-06 17:45:52 +08:00
committed by Noisyfox
parent 87c0719b32
commit 9c8736f416

View File

@@ -2974,7 +2974,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<std::string>();
ver_info.product_name = wxString::FromUTF8((*it).value("product_name", json()).get<string>());
if ((*it).contains("product_name"))
ver_info.product_name = wxString::FromUTF8((*it)["product_name"].get<string>());
if ((*it).contains("sw_ver"))
ver_info.sw_ver = (*it)["sw_ver"].get<std::string>();
if ((*it).contains("sn"))