[bug](json)Fix the problem of be down caused by json path ending with \ (#28180)
This commit is contained in:
@ -229,12 +229,19 @@ rapidjson::Value* get_json_object(std::string_view json_string, std::string_view
|
||||
std::vector<JsonPath>* parsed_paths;
|
||||
std::vector<JsonPath> tmp_parsed_paths;
|
||||
|
||||
//Cannot use '\' as the last character, return NULL
|
||||
if (path_string.back() == '\\') {
|
||||
document->SetNull();
|
||||
return document;
|
||||
}
|
||||
|
||||
#ifdef USE_LIBCPP
|
||||
std::string s(path_string);
|
||||
auto tok = get_json_token(s);
|
||||
#else
|
||||
auto tok = get_json_token(path_string);
|
||||
#endif
|
||||
|
||||
std::vector<std::string> paths(tok.begin(), tok.end());
|
||||
get_parsed_paths(paths, &tmp_parsed_paths);
|
||||
if (tmp_parsed_paths.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user