mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 19:38:09 +00:00
Fix crash on using peer address when not available
This commit is contained in:
parent
50f5ac696d
commit
2c4815460b
1 changed files with 17 additions and 3 deletions
|
|
@ -535,9 +535,23 @@ QList<QString> ChatRoomModel::getComposers(){
|
|||
}
|
||||
|
||||
QString ChatRoomModel::getParticipantAddress(){
|
||||
if(!isSecure())
|
||||
return Utils::coreStringToAppString(mChatRoom->getPeerAddress()->asString());
|
||||
else{
|
||||
if(!isSecure()){
|
||||
auto peerAddress = mChatRoom->getPeerAddress();
|
||||
if( peerAddress)
|
||||
return Utils::coreStringToAppString(peerAddress->asString());
|
||||
else if(isConference()){
|
||||
auto conferenceAddress = mChatRoom->getConferenceAddress();
|
||||
if( conferenceAddress)
|
||||
return Utils::coreStringToAppString(conferenceAddress->asString());
|
||||
else{
|
||||
qWarning() << "ConferenceAddress is NULL when requesting it from not secure and conference ChatRoomModel :" << mChatRoom.get();
|
||||
return "";
|
||||
}
|
||||
}else {
|
||||
qWarning() << "PeerAddress is NULL when requesting it from not secure ChatRoomModel :" << mChatRoom.get();
|
||||
return "";
|
||||
}
|
||||
}else{
|
||||
auto participants = getParticipants();
|
||||
if(participants->getCount() > 1)
|
||||
return participants->getAt(1)->getSipAddress();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue