diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-17 02:48:54 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-17 02:48:54 +0300 |
commit | 53cc3c86f2b5040cec577145feff9db2c93bd268 (patch) | |
tree | 44d3d91d85d9c10fbb8aa5636b0e72ebfea0c76f /src/gui/widgets | |
parent | 26f2c689298bb2077000b81ff3fe14328a89feb8 (diff) | |
download | plus-53cc3c86f2b5040cec577145feff9db2c93bd268.tar.gz plus-53cc3c86f2b5040cec577145feff9db2c93bd268.tar.bz2 plus-53cc3c86f2b5040cec577145feff9db2c93bd268.tar.xz plus-53cc3c86f2b5040cec577145feff9db2c93bd268.zip |
Fix some issues after automatic checks.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/tabbedarea.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_relations.cpp | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index dbfc068e6..2be152d4a 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -777,6 +777,8 @@ void TabbedArea::selectPrevTab() if (tab == 0) tab = static_cast<int>(mTabs.size()); + if (tab < 0) + return; tab--; setSelectedTab(mTabs[tab].first); } diff --git a/src/gui/widgets/tabs/setup_relations.cpp b/src/gui/widgets/tabs/setup_relations.cpp index 4b8be484c..ffa5e1a66 100644 --- a/src/gui/widgets/tabs/setup_relations.cpp +++ b/src/gui/widgets/tabs/setup_relations.cpp @@ -216,9 +216,11 @@ void Setup_Relations::action(const ActionEvent &event) } else if (eventId == ACTION_STRATEGY) { + const int sel = mIgnoreActionChoicesBox->getSelected(); + if (sel < 0) + return; PlayerIgnoreStrategy *const s = - (*player_relations.getPlayerIgnoreStrategies())[ - mIgnoreActionChoicesBox->getSelected()]; + (*player_relations.getPlayerIgnoreStrategies())[sel]; player_relations.setPlayerIgnoreStrategy(s); } |