mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
Added test and fixed some possible null pointer exception.
This commit is contained in:
parent
bf43ea9936
commit
07a7afa285
2 changed files with 8 additions and 7 deletions
|
|
@ -86,13 +86,14 @@ public class AddConditionalManaOfAnyColorEffect extends ManaEffect {
|
|||
int value = amount.calculate(game, source, this);
|
||||
boolean result = false;
|
||||
ChoiceColor choice = new ChoiceColor(true);
|
||||
while (!choice.isChosen()) {
|
||||
controller.choose(outcome, choice, game);
|
||||
if (!controller.isInGame()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < value; i++) {
|
||||
while (!choice.isChosen()) {
|
||||
controller.choose(outcome, choice, game);
|
||||
if (!controller.isInGame()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Mana mana = null;
|
||||
if (choice.getColor().isBlack()) {
|
||||
mana = manaBuilder.setMana(Mana.BlackMana(1), source, game).build();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue