ENH: add protection for old files

jira: [none]
Change-Id: Id1fc3e41a1fa3faf363c902c98a1a2b73820a569
(cherry picked from commit d621bea9382020bc024c4fa070718116de46216c)
This commit is contained in:
xin.zhang 2025-04-03 11:06:59 +08:00 committed by Noisyfox
parent da33d78799
commit 6494c35626

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")) {