gui: do not attempt to create context menu if idlist is empty

...and other side effects
This commit is contained in:
chelovechishko 2018-07-02 17:41:26 +09:00
parent 57cff61873
commit 4eb060e154

View File

@ -263,6 +263,8 @@ void ChatLobbyDialog::initParticipantsContextMenu(QMenu *contextMnu, QList<RsGxs
{
if (!contextMnu)
return;
if (idList.isEmpty())
return;
contextMnu->addAction(distantChatAct);
contextMnu->addAction(sendMessageAct);
@ -291,8 +293,6 @@ void ChatLobbyDialog::initParticipantsContextMenu(QMenu *contextMnu, QList<RsGxs
voteNegativeAct->setData(QVariant::fromValue(idList));
showInPeopleAct->setData(QVariant::fromValue(idList));
if(idList.count()==1)
{
RsGxsId gxsid = idList.at(0);
if(!gxsid.isNull() && !rsIdentity->isOwnId(gxsid))
@ -305,7 +305,6 @@ void ChatLobbyDialog::initParticipantsContextMenu(QMenu *contextMnu, QList<RsGxs
muteAct->setChecked(isParticipantMuted(gxsid));
}
}
}
void ChatLobbyDialog::voteParticipant()
{