summaryrefslogtreecommitdiff
path: root/src/gui/setup_relations.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/setup_relations.cpp')
-rw-r--r--src/gui/setup_relations.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gui/setup_relations.cpp b/src/gui/setup_relations.cpp
index 9ddef9e1a..571856a14 100644
--- a/src/gui/setup_relations.cpp
+++ b/src/gui/setup_relations.cpp
@@ -193,6 +193,8 @@ public:
std::string getPlayerAt(int index) const
{
+ if (index < 0 || index >= (signed)mPlayers->size())
+ return "";
return (*mPlayers)[index];
}
@@ -257,10 +259,7 @@ Setup_Relations::Setup_Relations():
mIgnoreActionChoicesBox = new DropDown(mIgnoreActionChoicesModel);
for (int i = 0; i < COLUMNS_NR; i++)
- {
- mPlayerTableTitleModel->set(0, i,
- new Label(gettext(table_titles[i])));
- }
+ mPlayerTableTitleModel->set(0, i, new Label(gettext(table_titles[i])));
mPlayerTitleTable->setLinewiseSelection(true);