FIX: fix the json assert

jira: none
Change-Id: I0d17ef2e8474e84397c92ecd7868c6313bb8c9f7
This commit is contained in:
xin.zhang 2025-01-06 17:45:52 +08:00 committed by lane.wei
parent 8aa7c070d3
commit ec2412ddec

View File

@ -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<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("sw_new_ver"))