summaryrefslogtreecommitdiff
path: root/src/gui/buddywindow.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <bertram@cegetel.net>2005-06-20 17:54:37 +0000
committerYohann Ferreira <bertram@cegetel.net>2005-06-20 17:54:37 +0000
commit4284ab680d079fe9f06a44df3a092cfd3e298895 (patch)
treeb8eabd8ea6f48fa375855893ca0ebd3efcaf803a /src/gui/buddywindow.cpp
parent12371444ef58176bbf7bd5716a223e707a5942e7 (diff)
downloadmana-client-4284ab680d079fe9f06a44df3a092cfd3e298895.tar.gz
mana-client-4284ab680d079fe9f06a44df3a092cfd3e298895.tar.bz2
mana-client-4284ab680d079fe9f06a44df3a092cfd3e298895.tar.xz
mana-client-4284ab680d079fe9f06a44df3a092cfd3e298895.zip
Bugfixes to the buddy window : preventing a crash when removing with no selection.
Diffstat (limited to 'src/gui/buddywindow.cpp')
-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);