Commit 0049b3e3 authored by louiz’'s avatar louiz’

Remove a potential nullptr dereference, on mam queryid

fix coverity CID 153376
parent 5477db79
......@@ -598,9 +598,8 @@ bool BiboumiComponent::handle_mam_request(const Stanza& stanza)
const auto lines = Database::get_muc_logs(from.bare(), iid.get_local(), iid.get_server(), -1, start, end);
for (const db::MucLogLine& line: lines)
const auto queryid = query->get_tag("queryid");
if (!line.nick.value().empty())
this->send_archived_message(line, to.full(), from.full(), queryid);
this->send_archived_message(line, to.full(), from.full(), query_id);
this->send_iq_result_full_jid(id, from.full(), to.full());
return true;
......@@ -617,7 +616,8 @@ void BiboumiComponent::send_archived_message(const db::MucLogLine& log_line, con
XmlNode result("result");
result["xmlns"] = MAM_NS;
result["queryid"] = queryid;
if (!queryid.empty())
result["queryid"] = queryid;
result["id"] = log_line.uuid.value();
XmlNode forwarded("forwarded");
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment