* Verdant Sun's Avatar - Fixed possible null pointer exception.

This commit is contained in:
LevelX2 2017-09-13 15:35:19 +02:00
parent c3157bbcde
commit f65cf063ea

View file

@ -36,8 +36,8 @@ import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
@ -91,7 +91,7 @@ class VerdantSunsAvatarTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent.isCreature()
if (permanent != null && permanent.isCreature()
&& permanent.getControllerId().equals(this.controllerId)) {
Effect effect = this.getEffects().get(0);
// Life is determined during resolution so it has to be retrieved there (e.g. Giant Growth before resolution)