diff --git a/Linphone/core/call/CallCore.cpp b/Linphone/core/call/CallCore.cpp index 5d5d402d4..d5005e589 100644 --- a/Linphone/core/call/CallCore.cpp +++ b/Linphone/core/call/CallCore.cpp @@ -786,7 +786,8 @@ void CallCore::findRemoteFriend(QSharedPointer me) { if (remoteFriend) name = Utils::coreStringToAppString(remoteFriend->getName()); else if (results.size() > 0) // Then result address. name = Utils::coreStringToAppString(results.front()->getAddress()->getDisplayName()); - if (name.isEmpty()) name = Utils::coreStringToAppString(results.front()->getAddress()->getUsername()); + if (name.isEmpty() && results.size() > 0) + name = Utils::coreStringToAppString(results.front()->getAddress()->getUsername()); if (!name.isEmpty()) mRemoteMagicSearchModelConnection->invokeToCore([this, name]() { mustBeInMainThread(log().arg(Q_FUNC_INFO));