diff options
author | Yohann Ferreira <bertram@cegetel.net> | 2005-06-20 17:54:37 +0000 |
---|---|---|
committer | Yohann Ferreira <bertram@cegetel.net> | 2005-06-20 17:54:37 +0000 |
commit | 4284ab680d079fe9f06a44df3a092cfd3e298895 (patch) | |
tree | b8eabd8ea6f48fa375855893ca0ebd3efcaf803a /src/gui/buddywindow.cpp | |
parent | 12371444ef58176bbf7bd5716a223e707a5942e7 (diff) | |
download | mana-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.cpp | 7 |
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); |