From eb019ab915998a3ec247b33dad4b23f763d7a29a Mon Sep 17 00:00:00 2001 From: Dennis Friis Date: Mon, 9 Jun 2008 15:03:14 +0000 Subject: Fix for segfault in drop down list of player ignore and sanity check for /whisper ignore. Patch by fate. --- src/gui/setup_players.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/gui/setup_players.cpp') 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); -- cgit v1.2.3-70-g09d2