mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-03 22:56:49 +00:00
fix(CoreManager): replace assert by log if chat model id is invalid in getChatModel (avoid crash for specific migrated chat rooms)
This commit is contained in:
parent
0b3fd4bea2
commit
bc0de77024
1 changed files with 8 additions and 2 deletions
|
|
@ -121,8 +121,14 @@ shared_ptr<ChatModel> CoreManager::getChatModel (const QString &peerAddress, con
|
|||
// Create a new chat model.
|
||||
QPair<QString, QString> chatModelId{ peerAddress, localAddress };
|
||||
if (!mChatModels.contains(chatModelId)) {
|
||||
Q_ASSERT(mCore->createAddress(Utils::appStringToCoreString(peerAddress)));
|
||||
Q_ASSERT(mCore->createAddress(Utils::appStringToCoreString(localAddress)));
|
||||
if (
|
||||
!mCore->createAddress(Utils::appStringToCoreString(peerAddress)) ||
|
||||
!mCore->createAddress(Utils::appStringToCoreString(localAddress))
|
||||
) {
|
||||
qWarning() << QStringLiteral("Unable to get chat model from invalid chat model id: (%1, %2).")
|
||||
.arg(peerAddress).arg(localAddress);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto deleter = [this, chatModelId](ChatModel *chatModel) {
|
||||
bool removed = mChatModels.remove(chatModelId);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue