[Bug] Fix null pointer access in json-load (#3692)

Add check for null pointer to avoid core dump
This commit is contained in:
worker24h
2020-05-26 22:41:30 +08:00
committed by GitHub
parent dcd5e5df12
commit fb66bac5fe

View File

@ -116,7 +116,7 @@ rapidjson::Value* JsonFunctions::match_value(std::vector<JsonPath>& parsed_paths
for (int i = 1; i < parsed_paths.size(); i++) {
VLOG(10) << "parsed_paths: " << parsed_paths[i].debug_string();
if (root->IsNull()) {
if (root == nullptr || root->IsNull()) {
return nullptr;
}