diff --git a/Mage.Sets/src/mage/sets/zendikar/GatekeeperOfMalakir.java b/Mage.Sets/src/mage/sets/zendikar/GatekeeperOfMalakir.java index df56465f59..8f2d245b3d 100644 --- a/Mage.Sets/src/mage/sets/zendikar/GatekeeperOfMalakir.java +++ b/Mage.Sets/src/mage/sets/zendikar/GatekeeperOfMalakir.java @@ -32,6 +32,7 @@ import mage.Constants.CardType; import mage.Constants.Duration; import mage.Constants.Rarity; import mage.MageInt; +import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.condition.common.KickedCondition; import mage.abilities.costs.mana.KickerManaCost; @@ -72,9 +73,10 @@ public class GatekeeperOfMalakir extends CardImpl { EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new SacrificeEffect(filter, 1, "target player")); - ability.addTarget(new TargetPlayer()); - this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), "When {this} enters the battlefield, if it was kicked, target player sacrifices a creature")); + Ability conditionalAbility = new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), "When {this} enters the battlefield, if it was kicked, target player sacrifices a creature"); + conditionalAbility.addTarget(new TargetPlayer()); + this.addAbility(conditionalAbility); } public GatekeeperOfMalakir(final GatekeeperOfMalakir card) { diff --git a/Mage/src/mage/abilities/effects/common/SacrificeEffect.java b/Mage/src/mage/abilities/effects/common/SacrificeEffect.java index cee2399016..847ba816a6 100644 --- a/Mage/src/mage/abilities/effects/common/SacrificeEffect.java +++ b/Mage/src/mage/abilities/effects/common/SacrificeEffect.java @@ -72,6 +72,9 @@ public class SacrificeEffect extends OneShotEffect{ @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(targetPointer.getFirst(source)); + if (player == null) { + return false; + } //filter.setTargetController(TargetController.YOU); int amount = count.calculate(game, source); amount = Math.min(amount, game.getBattlefield().countAll(filter, player.getId()));