summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tabs
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/tabs')
-rw-r--r--src/gui/widgets/tabs/setup_relations.cpp6
1 files changed, 4 insertions, 2 deletions
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);
}