Commit 98870fa0 authored by nannanko Suki's avatar nannanko Suki
Browse files

Fix crash that nlohmann cant found key "algorithm"

parent 57be58ed
Pipeline #1229 failed with stages
in 5 seconds
......@@ -386,7 +386,7 @@ namespace Kazv
MaybeString Crypto::decrypt(nlohmann::json eventJson)
{
auto content = eventJson.at("content");
auto algo = content.at("algorithm").get<std::string>();
auto algo = content.contains("algorithm") ? content.at("algorithm").template get<std::string>() : std::string();
if (algo == olmAlgo) {
return m_d->decryptOlm(std::move(content));
} else if (algo == megOlmAlgo) {
......
Supports Markdown
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