* Reflecting Pool - Fixed possible NPE.

This commit is contained in:
LevelX2 2014-02-28 14:18:14 +01:00
parent e4a1f70057
commit 024ec1169a

View file

@ -131,19 +131,30 @@ class ReflectingPoolEffect extends ManaEffect<ReflectingPoolEffect> {
} else { } else {
player.choose(outcome, choice, game); player.choose(outcome, choice, game);
} }
if (choice.getChoice().equals("Black")) { if (choice.getChoice() != null) {
player.getManaPool().addMana(Mana.BlackMana, game, source); switch (choice.getChoice()) {
} else if (choice.getChoice().equals("Blue")) { case "Black":
player.getManaPool().addMana(Mana.BlueMana, game, source); player.getManaPool().addMana(Mana.BlackMana, game, source);
} else if (choice.getChoice().equals("Red")) { break;
player.getManaPool().addMana(Mana.RedMana, game, source); case "Blue":
} else if (choice.getChoice().equals("Green")) { player.getManaPool().addMana(Mana.BlueMana, game, source);
player.getManaPool().addMana(Mana.GreenMana, game, source); break;
} else if (choice.getChoice().equals("White")) { case "Red":
player.getManaPool().addMana(Mana.WhiteMana, game, source); player.getManaPool().addMana(Mana.RedMana, game, source);
} else if (choice.getChoice().equals("Colorless")) { break;
player.getManaPool().addMana(Mana.ColorlessMana, game, source); case "Green":
player.getManaPool().addMana(Mana.GreenMana, game, source);
break;
case "White":
player.getManaPool().addMana(Mana.WhiteMana, game, source);
break;
case "Colorless":
player.getManaPool().addMana(Mana.ColorlessMana, game, source);
break;
}
return true;
} }
return false;
} }
return true; return true;
} }