ENH: add protection for old files

jira: [none]
Change-Id: Id1fc3e41a1fa3faf363c902c98a1a2b73820a569
This commit is contained in:
xin.zhang 2025-04-03 11:06:59 +08:00 committed by lane.wei
parent c151680321
commit d621bea938
1 changed files with 2 additions and 2 deletions

View File

@ -196,9 +196,9 @@ int HMSQuery::load_from_local(const std::string& hms_type, const std::string& de
{
const json &j = json::parse(json_file);
if (hms_type.compare(QUERY_HMS_INFO) == 0) {
(*load_json) = j["data"];
if (j.contains("data")) { (*load_json) = j["data"]; }
} else if (hms_type.compare(QUERY_HMS_ACTION) == 0) {
(*load_json)["data"] = j["data"];
if (j.contains("data")) { (*load_json)["data"] = j["data"]; }
}
if (j.contains("version")) {