- Little fix Cradle of Vitality. (null check)

This commit is contained in:
jeffwadsworth 2020-06-02 10:43:37 -05:00
parent aed44cd0cc
commit 47af865bc3

View file

@ -61,7 +61,10 @@ class CradleOfVitalityEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
int lifeGained = (Integer) this.getValue("gainedLife");
int lifeGained = 0;
if (this.getValue("gainedLife") != null) {
lifeGained = (Integer) this.getValue("gainedLife");
}
return permanent != null && lifeGained > 0
&& permanent.addCounters(CounterType.P1P1.createInstance(lifeGained), source, game);
}