Skip to content

Commit

Permalink
Merge "Check for parse error before using the json document"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Mar 7, 2016
2 parents acf4c45 + 4107e51 commit 37b2721
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/query_engine/select.cc
Expand Up @@ -443,7 +443,12 @@ query_status_t SelectQuery::process_query() {

//uint64_t thenj = UTCTimestampUsec();
rapidjson::Document d;
d.Parse<0>(const_cast<char *>(json_string.c_str()));
if (d.Parse<0>(const_cast<char *>(
json_string.c_str())).HasParseError()) {
QE_LOG(ERROR, "Error parsing json document: " <<
d.GetParseError() << " - " << json_string);
continue;
}
//jsont += UTCTimestampUsec() - thenj;

std::vector<StatsSelect::StatEntry> attribs;
Expand Down

0 comments on commit 37b2721

Please sign in to comment.