[MIC] fixed Prowling Geistcatcher error when no cards are exiled (fixes #8797)

This commit is contained in:
Evan Kranzler 2022-03-28 18:58:04 -04:00
parent dafbed3581
commit 254ed6a94e

View file

@ -14,6 +14,7 @@ import mage.constants.SubType;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.game.ExileZone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentToken;
@ -110,11 +111,8 @@ class ProwlingGeistcatcherReturnEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
return player.moveCards(game.getExile().getExileZone(
CardUtil.getExileZoneId(game, source)
), Zone.BATTLEFIELD, source, game);
ExileZone exileZone = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source));
return player != null && exileZone != null && !exileZone.isEmpty()
&& player.moveCards(exileZone, Zone.BATTLEFIELD, source, game);
}
}