diff options
author | Dennis Friis <peavey@placid.dk> | 2008-06-09 15:03:14 +0000 |
---|---|---|
committer | Dennis Friis <peavey@placid.dk> | 2008-06-09 15:03:14 +0000 |
commit | eb019ab915998a3ec247b33dad4b23f763d7a29a (patch) | |
tree | 54c4844a719942376327dac8678476524c54db6c /src/gui/setup_players.cpp | |
parent | 0dd4c03506132c5f4a7104152d8675d6990ba81b (diff) | |
download | mana-client-eb019ab915998a3ec247b33dad4b23f763d7a29a.tar.gz mana-client-eb019ab915998a3ec247b33dad4b23f763d7a29a.tar.bz2 mana-client-eb019ab915998a3ec247b33dad4b23f763d7a29a.tar.xz mana-client-eb019ab915998a3ec247b33dad4b23f763d7a29a.zip |
Fix for segfault in drop down list of player ignore and sanity check for /whisper ignore. Patch by fate.
Diffstat (limited to 'src/gui/setup_players.cpp')
-rw-r--r-- | src/gui/setup_players.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/setup_players.cpp b/src/gui/setup_players.cpp index ae0e7271..20a225b8 100644 --- a/src/gui/setup_players.cpp +++ b/src/gui/setup_players.cpp @@ -320,7 +320,12 @@ Setup_Players::action(const gcn::ActionEvent &event) player_relations.addListener(this); } else if (event.getId() == ACTION_DELETE) { - std::string name = mPlayerTableModel->getPlayerAt(mPlayerTable->getSelectedRow()); + int player_index = mPlayerTable->getSelectedRow(); + + if (player_index < 0) + return; + + std::string name = mPlayerTableModel->getPlayerAt(player_index); player_relations.removePlayer(name); |