From ea532fef905374f32976bddff35e0ae2870b453c Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Thu, 10 Jan 2019 20:56:59 +0400 Subject: [PATCH] * Tunnel Ignus - fixed NPE error for AI; --- Mage.Sets/src/mage/cards/t/TunnelIgnus.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Mage.Sets/src/mage/cards/t/TunnelIgnus.java b/Mage.Sets/src/mage/cards/t/TunnelIgnus.java index 051479ad23..13fc420221 100644 --- a/Mage.Sets/src/mage/cards/t/TunnelIgnus.java +++ b/Mage.Sets/src/mage/cards/t/TunnelIgnus.java @@ -1,10 +1,5 @@ - package mage.cards.t; -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; -import java.util.UUID; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; @@ -22,6 +17,11 @@ import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; import mage.watchers.Watcher; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.UUID; + /** * @author Loki */ @@ -72,8 +72,7 @@ class TunnelIgnusWatcher extends Watcher { public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent.isLand() && game.getOpponents(this.controllerId).contains(permanent.getControllerId())) { - + if (permanent != null && permanent.isLand() && game.getOpponents(this.controllerId).contains(permanent.getControllerId())) { int count = counts.getOrDefault(permanent.getControllerId(), 0); counts.put(permanent.getControllerId(), count + 1); }