From 1666d7b897a9223f5cacb586f1cf765cd6af12b5 Mon Sep 17 00:00:00 2001 From: Christophe Deschamps Date: Tue, 27 May 2025 18:03:19 +0200 Subject: [PATCH] Verify the event is chat before accessing the model --- Linphone/core/chat/ChatCore.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Linphone/core/chat/ChatCore.cpp b/Linphone/core/chat/ChatCore.cpp index 517abd3a9..a46e6024b 100644 --- a/Linphone/core/chat/ChatCore.cpp +++ b/Linphone/core/chat/ChatCore.cpp @@ -191,7 +191,8 @@ void ChatCore::setSelf(QSharedPointer me) { }); mChatModelConnection->makeConnectToCore(&ChatCore::lUpdateLastMessage, [this]() { - auto lastMessageModel = mLastEvent ? mLastEvent->getChatMessageCore()->getModel() : nullptr; + auto lastMessageModel = + mLastEvent && mLastEvent->getChatMessageCore() ? mLastEvent->getChatMessageCore()->getModel() : nullptr; mChatModelConnection->invokeToModel([this, lastMessageModel]() { auto linphoneMessage = mChatModel->getLastChatMessage(); if (!lastMessageModel || lastMessageModel->getMonitor() != linphoneMessage) {