mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
- added some null checks. #5537
This commit is contained in:
parent
badfd1c59e
commit
1ef5d878c6
2 changed files with 13 additions and 8 deletions
|
|
@ -70,12 +70,14 @@ public class AddManaOfAnyColorEffect extends BasicManaEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
String mes = String.format("Select color of %d mana to add it", this.amount);
|
||||
ChoiceColor choice = new ChoiceColor(true, mes, game.getObject(source.getSourceId()));
|
||||
if (controller.choose(outcome, choice, game)) {
|
||||
if (choice.getColor() != null) {
|
||||
Mana mana = choice.getMana(amount);
|
||||
mana.setFlag(setFlag);
|
||||
return mana;
|
||||
if (mes != null) {
|
||||
ChoiceColor choice = new ChoiceColor(true, mes, game.getObject(source.getSourceId()));
|
||||
if (controller.choose(outcome, choice, game)) {
|
||||
if (choice.getColor() != null) {
|
||||
Mana mana = choice.getMana(amount);
|
||||
mana.setFlag(setFlag);
|
||||
return mana;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue