From 6de177f8ac236aba1b285b0e8e3a39187778a3e9 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 7 Jan 2018 22:23:41 +0100 Subject: [PATCH] * Order of Succession - Fixed possible exception error. --- Mage.Sets/src/mage/cards/o/OrderOfSuccession.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Mage.Sets/src/mage/cards/o/OrderOfSuccession.java b/Mage.Sets/src/mage/cards/o/OrderOfSuccession.java index 4bfa6ea357..fa5a5d8d06 100644 --- a/Mage.Sets/src/mage/cards/o/OrderOfSuccession.java +++ b/Mage.Sets/src/mage/cards/o/OrderOfSuccession.java @@ -58,8 +58,7 @@ import mage.target.targetpointer.FixedTarget; public class OrderOfSuccession extends CardImpl { public OrderOfSuccession(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{U}"); - + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{U}"); // Choose left or right. Starting with you and proceeding in the chosen direction, each player chooses a creature controlled by the next player in that direction. Each player gains control of the creature he or she chose. this.getSpellAbility().addEffect(new OrderOfSuccessionEffect()); @@ -98,7 +97,7 @@ class OrderOfSuccessionEffect extends OneShotEffect { Map playerCreature = new HashMap<>(2); Choice choice = new ChoiceLeftOrRight(); controller.choose(Outcome.Neutral, choice, game); - boolean left = choice.getChoice().equals("Left"); + boolean left = choice == null || choice.getChoice().equals("Left"); // to prevent npe PlayerList playerList = game.getState().getPlayerList().copy(); // set playerlist to controller while (!playerList.get().equals(source.getControllerId()) && controller.canRespond()) { @@ -108,7 +107,7 @@ class OrderOfSuccessionEffect extends OneShotEffect { Player nextPlayer; UUID firstNextPlayer = null; - while (!getNextPlayerInDirection(left, playerList, game).equals(firstNextPlayer) && controller.canRespond()){ + while (!getNextPlayerInDirection(left, playerList, game).equals(firstNextPlayer) && controller.canRespond()) { nextPlayer = game.getPlayer(playerList.get()); if (nextPlayer == null) { return false;