diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-02-02 05:11:50 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-02-02 05:11:50 +0300 |
commit | f498d80c587033bffb9abedb2b0827ad8d4a2a32 (patch) | |
tree | 82da8928768b2159c199c2d033388a071f228582 /src/gui/setup_relations.cpp | |
parent | 1ba44aeb62414ea349e462b6d4fccbaac00be115 (diff) | |
download | manaverse-f498d80c587033bffb9abedb2b0827ad8d4a2a32.tar.gz manaverse-f498d80c587033bffb9abedb2b0827ad8d4a2a32.tar.bz2 manaverse-f498d80c587033bffb9abedb2b0827ad8d4a2a32.tar.xz manaverse-f498d80c587033bffb9abedb2b0827ad8d4a2a32.zip |
Add some checks after automatic checking.
Diffstat (limited to 'src/gui/setup_relations.cpp')
-rw-r--r-- | src/gui/setup_relations.cpp | 7 |
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); |