mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08:00
fix #13097 (Pollywog Prodigy - NPE in predicate)
This commit is contained in:
parent
02db93b75c
commit
34c1e79612
1 changed files with 8 additions and 9 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
package mage.cards.p;
|
package mage.cards.p;
|
||||||
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
|
import mage.MageObject;
|
||||||
import mage.abilities.common.SpellCastOpponentTriggeredAbility;
|
import mage.abilities.common.SpellCastOpponentTriggeredAbility;
|
||||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||||
import mage.abilities.keyword.EvolveAbility;
|
import mage.abilities.keyword.EvolveAbility;
|
||||||
|
|
@ -15,6 +16,7 @@ import mage.filter.predicate.Predicates;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.stack.StackObject;
|
import mage.game.stack.StackObject;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -62,13 +64,10 @@ enum PollywogProdigyPredicate implements ObjectSourcePlayerPredicate<StackObject
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(ObjectSourcePlayer<StackObject> input, Game game) {
|
public boolean apply(ObjectSourcePlayer<StackObject> input, Game game) {
|
||||||
return input
|
return Optional
|
||||||
.getObject()
|
.ofNullable(input.getSource().getSourcePermanentOrLKI(game))
|
||||||
.getManaValue()
|
.map(MageObject::getPower)
|
||||||
< input
|
.map(p -> input.getObject().getManaValue() < p.getValue())
|
||||||
.getSource()
|
.orElse(false);
|
||||||
.getSourcePermanentIfItStillExists(game)
|
|
||||||
.getPower()
|
|
||||||
.getValue();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue