summaryrefslogtreecommitdiff
path: root/src/gui/setup_relations.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-02-02 05:11:50 +0300
committerAndrei Karas <akaras@inbox.ru>2012-02-02 05:11:50 +0300
commitf498d80c587033bffb9abedb2b0827ad8d4a2a32 (patch)
tree82da8928768b2159c199c2d033388a071f228582 /src/gui/setup_relations.cpp
parent1ba44aeb62414ea349e462b6d4fccbaac00be115 (diff)
downloadmanaplus-f498d80c587033bffb9abedb2b0827ad8d4a2a32.tar.gz
manaplus-f498d80c587033bffb9abedb2b0827ad8d4a2a32.tar.bz2
manaplus-f498d80c587033bffb9abedb2b0827ad8d4a2a32.tar.xz
manaplus-f498d80c587033bffb9abedb2b0827ad8d4a2a32.zip
Add some checks after automatic checking.
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);