* 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 {
player.choose(outcome, choice, game);
}
if (choice.getChoice().equals("Black")) {
player.getManaPool().addMana(Mana.BlackMana, game, source);
} else if (choice.getChoice().equals("Blue")) {
player.getManaPool().addMana(Mana.BlueMana, game, source);
} else if (choice.getChoice().equals("Red")) {
player.getManaPool().addMana(Mana.RedMana, game, source);
} else if (choice.getChoice().equals("Green")) {
player.getManaPool().addMana(Mana.GreenMana, game, source);
} else if (choice.getChoice().equals("White")) {
player.getManaPool().addMana(Mana.WhiteMana, game, source);
} else if (choice.getChoice().equals("Colorless")) {
player.getManaPool().addMana(Mana.ColorlessMana, game, source);
if (choice.getChoice() != null) {
switch (choice.getChoice()) {
case "Black":
player.getManaPool().addMana(Mana.BlackMana, game, source);
break;
case "Blue":
player.getManaPool().addMana(Mana.BlueMana, game, source);
break;
case "Red":
player.getManaPool().addMana(Mana.RedMana, game, source);
break;
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;
}