Fix crash when sending messages

ECM recently started adding -fhardened, which makes us crash here since we're doing things that aren't valid, but happened to work out fine previously.
This commit is contained in:
Tobias Fella
2024-12-11 17:16:10 +01:00
parent 7d3f478a74
commit 0d286db0c2

View File

@@ -319,7 +319,8 @@ void ChatBarCache::postMessage()
return;
}
room->postMessage(text(), sendText, *std::get<std::optional<Quotient::RoomMessageEvent::MsgType>>(result), replyId(), editId(), threadId());
auto type = std::get<std::optional<Quotient::RoomMessageEvent::MsgType>>(result);
room->postMessage(text(), sendText, type ? *type : Quotient::RoomMessageEvent::MsgType::Text, replyId(), editId(), threadId());
clearCache();
}