Skip to content

Commit

Permalink
Merge pull request #148 from telefonicaid/bug/IDAS-20505
Browse files Browse the repository at this point in the history
remove queryContext condition, body with no attributes is alloed
  • Loading branch information
rbl219 committed May 25, 2015
2 parents b6e0bd3 + 29e775f commit 4640dcd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ngsi/QueryContext.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,15 @@ iota::QueryContext::QueryContext(const std::istringstream& str_query) {
add_entity(entitiy);
}

if (!document.HasMember(iota::ngsi::NGSI_ATTRIBUTES.c_str()) ||
if (document.HasMember(iota::ngsi::NGSI_ATTRIBUTES.c_str()) &&
!document[iota::ngsi::NGSI_ATTRIBUTES.c_str()].IsArray()) {
std::ostringstream what;
what << "QueryContext: ";
what << "invalid or missing field [";
what << iota::ngsi::NGSI_ATTRIBUTES;
what << "]";
throw std::runtime_error(what.str());

}
const rapidjson::Value& attributes = document["attributes"];

Expand Down

0 comments on commit 4640dcd

Please sign in to comment.