From bda59fafcf900270bc510d8af06ff787b5436073 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 26 Nov 2014 12:29:42 +0100 Subject: [PATCH] * Fixed possible exception during choosing replacement effect resolve order. --- .../src/mage/player/human/HumanPlayer.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java index 0b4fc155a0..7d382e014c 100644 --- a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java @@ -197,12 +197,14 @@ public class HumanPlayer extends PlayerImpl { } else { replacementEffectChoice.setChoiceByKey(response.getString()); } - int index = 0; - for (String key : rEffects.keySet()) { - if (replacementEffectChoice.getChoiceKey().equals(key)) { - return index; + if (replacementEffectChoice.getChoiceKey() != null) { + int index = 0; + for (String key : rEffects.keySet()) { + if (replacementEffectChoice.getChoiceKey().equals(key)) { + return index; + } + index++; } - index++; } } }