summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/buddywindow.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/buddywindow.cpp b/src/gui/buddywindow.cpp
index be6ee5ee..748ecb97 100644
--- a/src/gui/buddywindow.cpp
+++ b/src/gui/buddywindow.cpp
@@ -72,8 +72,11 @@ void BuddyWindow::action(const std::string& eventId)
}
else if (eventId == "Remove") {
int selected = listbox->getSelected();
- std::string who = getElementAt(selected);
- removeBuddy(who);
+ if ( selected > -1 )
+ {
+ std::string who = getElementAt(selected);
+ removeBuddy(who);
+ }
}
else if (eventId == "Cancel") {
setVisible(false);