From 4435ccf2284034e50b25dbc9df8d03818bc42346 Mon Sep 17 00:00:00 2001 From: joss17 Date: Sun, 14 Feb 2010 14:17:58 +0000 Subject: [PATCH] remove a bug in peersdialog git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2317 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/PeersDialog.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 );