Fix some issues found by sonar cube

This commit is contained in:
louiz’
2017-01-06 23:45:26 +01:00
parent 6bf9cedbeb
commit e31ff3e9e9
3 changed files with 6 additions and 11 deletions
+2 -7
View File
@@ -62,13 +62,8 @@ XmlNode AdhocCommandsHandler::handle_request(const std::string& executor_jid, co
"adhocsession"s + sessionid + executor_jid));
}
auto session_it = this->sessions.find(std::make_pair(sessionid, executor_jid));
if (session_it == this->sessions.end())
{
XmlSubNode error(command_node, ADHOC_NS":error");
error["type"] = "modify";
XmlSubNode condition(error, STANZA_NS":bad-request");
}
else if (action == "execute" || action == "next" || action == "complete")
if ((session_it != this->sessions.end()) &&
(action == "execute" || action == "next" || action == "complete"))
{
// execute the step
AdhocSession& session = session_it->second;