diff --git a/retroshare-gui/src/gui/PeersDialog.cpp b/retroshare-gui/src/gui/PeersDialog.cpp index e870131f2..31dc4ffcc 100644 --- a/retroshare-gui/src/gui/PeersDialog.cpp +++ b/retroshare-gui/src/gui/PeersDialog.cpp @@ -211,6 +211,11 @@ PeersDialog::PeersDialog(QWidget *parent) void PeersDialog::peertreeWidgetCostumPopupMenu( QPoint point ) { + QTreeWidgetItem *c = getCurrentPeer(); + if (!c) { + //no peer selected + return; + } QMenu contextMnu( this ); QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier ); @@ -239,7 +244,6 @@ void PeersDialog::peertreeWidgetCostumPopupMenu( QPoint point ) exportfriendAct = new QAction(QIcon(IMAGE_EXPIORTFRIEND), tr( "Export Friend" ), this ); connect( exportfriendAct , SIGNAL( triggered() ), this, SLOT( exportfriend() ) ); - QTreeWidgetItem *c = getCurrentPeer(); if (c->type() == 0) { //this is a GPG key removefriendAct = new QAction(QIcon(IMAGE_REMOVEFRIEND), tr( "Deny Friend" ), this );