From 3af2d11992dc7d74b71e00069d0f8e21f3d8ffff Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 17 Sep 2020 20:03:57 -0400 Subject: [PATCH] [ZNR] fixed an error with Nimble Trapfinder rules text (#7046) --- Mage.Sets/src/mage/cards/n/NimbleTrapfinder.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/cards/n/NimbleTrapfinder.java b/Mage.Sets/src/mage/cards/n/NimbleTrapfinder.java index 4d47fd1577..92ab23debc 100644 --- a/Mage.Sets/src/mage/cards/n/NimbleTrapfinder.java +++ b/Mage.Sets/src/mage/cards/n/NimbleTrapfinder.java @@ -85,7 +85,7 @@ enum NimbleTrapfinderCondition implements Condition { @Override public boolean apply(Game game, Ability source) { NimbleTrapfinderWatcher watcher = game.getState().getWatcher(NimbleTrapfinderWatcher.class); - return watcher != null && watcher.checkPlayer(game.getPermanent(source.getSourceId()), game); + return watcher != null && watcher.checkPlayer(source.getSourceId(), game); } @Override @@ -133,7 +133,11 @@ class NimbleTrapfinderWatcher extends Watcher { playerMap.clear(); } - boolean checkPlayer(Permanent permanent, Game game) { + boolean checkPlayer(UUID sourceId, Game game) { + Permanent permanent = game.getPermanent(sourceId); + if (permanent == null) { + return !playerMap.computeIfAbsent(game.getOwnerId(sourceId), u -> new HashSet<>()).isEmpty(); + } return playerMap .computeIfAbsent(permanent.getControllerId(), u -> new HashSet<>()) .stream()