From 9cd4a7416e0485917334c9448ce09c1800dca2ed Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Tue, 10 Dec 2024 21:05:01 +0100 Subject: [PATCH] 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. --- src/chatbarcache.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/chatbarcache.cpp b/src/chatbarcache.cpp index 24879d75a..b136595ac 100644 --- a/src/chatbarcache.cpp +++ b/src/chatbarcache.cpp @@ -338,7 +338,8 @@ void ChatBarCache::postMessage() relatesTo = Quotient::EventRelation::replyTo(replyId()); } - room->post(text(), *std::get>(result), std::move(content), relatesTo); + const auto type = std::get>(result); + room->post(text(), type ? *type : Quotient::RoomMessageEvent::MsgType::Text, std::move(content), relatesTo); clearCache(); }