Skip to content

Commit

Permalink
fix #13097 (Pollywog Prodigy - NPE in predicate)
Browse files Browse the repository at this point in the history
  • Loading branch information
xenohedron committed Dec 1, 2024
1 parent 02db93b commit 34c1e79
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions Mage.Sets/src/mage/cards/p/PollywogProdigy.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package mage.cards.p;

import mage.MageInt;
import mage.MageObject;
import mage.abilities.common.SpellCastOpponentTriggeredAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.keyword.EvolveAbility;
Expand All @@ -15,6 +16,7 @@
import mage.game.Game;
import mage.game.stack.StackObject;

import java.util.Optional;
import java.util.UUID;

/**
Expand Down Expand Up @@ -62,13 +64,10 @@ enum PollywogProdigyPredicate implements ObjectSourcePlayerPredicate<StackObject

@Override
public boolean apply(ObjectSourcePlayer<StackObject> input, Game game) {
return input
.getObject()
.getManaValue()
< input
.getSource()
.getSourcePermanentIfItStillExists(game)
.getPower()
.getValue();
return Optional
.ofNullable(input.getSource().getSourcePermanentOrLKI(game))
.map(MageObject::getPower)
.map(p -> input.getObject().getManaValue() < p.getValue())
.orElse(false);
}
}
}

0 comments on commit 34c1e79

Please sign in to comment.