Fixed possible NPE of AddManaOfAnyColorEffect.

This commit is contained in:
LevelX2 2014-09-15 07:50:51 +02:00
parent 217eaa55d7
commit fc5d730f0a

View file

@ -72,6 +72,9 @@ public class AddManaOfAnyColorEffect extends BasicManaEffect {
ChoiceColor choice = new ChoiceColor(false); ChoiceColor choice = new ChoiceColor(false);
if (controller.choose(outcome, choice, game)) { if (controller.choose(outcome, choice, game)) {
if (choice.getColor() == null) {
return false; // it happenes, don't know how
}
Mana createdMana = null; Mana createdMana = null;
if (choice.getColor().isBlack()) { if (choice.getColor().isBlack()) {
createdMana = Mana.BlackMana(amount); createdMana = Mana.BlackMana(amount);