Fix MessageContentModel crash
Make sure we check that the RoomMessageEvent exists before accessing anything
This commit is contained in:
@@ -499,7 +499,10 @@ void MessageContentModel::updateReplyModel()
|
|||||||
}
|
}
|
||||||
|
|
||||||
const auto roomMessageEvent = eventCast<const Quotient::RoomMessageEvent>(event.first);
|
const auto roomMessageEvent = eventCast<const Quotient::RoomMessageEvent>(event.first);
|
||||||
if (!roomMessageEvent->isReply() || (roomMessageEvent && roomMessageEvent->isThreaded() && NeoChatConfig::self()->threads())) {
|
if (roomMessageEvent == nullptr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!roomMessageEvent->isReply() || (roomMessageEvent->isThreaded() && NeoChatConfig::self()->threads())) {
|
||||||
if (m_replyModel) {
|
if (m_replyModel) {
|
||||||
delete m_replyModel;
|
delete m_replyModel;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user