summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/setup_players.cpp7
-rw-r--r--src/gui/table.cpp5
2 files changed, 10 insertions, 2 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);
diff --git a/src/gui/table.cpp b/src/gui/table.cpp
index 07f40f76..89a93825 100644
--- a/src/gui/table.cpp
+++ b/src/gui/table.cpp
@@ -109,6 +109,7 @@ GuiTable::setModel(TableModel *new_model)
recomputeDimensions();
}
+
void
GuiTable::recomputeDimensions(void)
{
@@ -347,8 +348,10 @@ GuiTable::modelUpdated(bool completed)
if (completed) {
recomputeDimensions();
installActionListeners();
- } else // before the update?
+ } else { // before the update?
+ mTopWidget = NULL; // No longer valid in general
uninstallActionListeners();
+ }
}
gcn::Widget *