ENH: add protection for old files
jira: [none] Change-Id: Id1fc3e41a1fa3faf363c902c98a1a2b73820a569
This commit is contained in:
parent
c151680321
commit
d621bea938
|
@ -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);
|
const json &j = json::parse(json_file);
|
||||||
if (hms_type.compare(QUERY_HMS_INFO) == 0) {
|
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) {
|
} 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")) {
|
if (j.contains("version")) {
|
||||||
|
|
Loading…
Reference in New Issue