* Tunnel Ignus - fixed NPE error for AI;
-
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);
}
