From f498d80c587033bffb9abedb2b0827ad8d4a2a32 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 2 Feb 2012 05:11:50 +0300 Subject: Add some checks after automatic checking. --- src/gui/setup_relations.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/gui/setup_relations.cpp') 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); -- cgit v1.2.3-60-g2f50