From c82feb1b9d9927dc18800a6d18a8591b850de93d Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 4 Dec 2020 15:40:34 +0100 Subject: [PATCH] * Genesis Ultimatum - prevented possible exception during card moving (fixes #7220). --- Mage.Sets/src/mage/cards/g/GenesisUltimatum.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/cards/g/GenesisUltimatum.java b/Mage.Sets/src/mage/cards/g/GenesisUltimatum.java index 47dbbfcfcf4..b64d02a10f7 100644 --- a/Mage.Sets/src/mage/cards/g/GenesisUltimatum.java +++ b/Mage.Sets/src/mage/cards/g/GenesisUltimatum.java @@ -1,5 +1,6 @@ package mage.cards.g; +import java.util.Objects; import mage.MageItem; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; @@ -69,7 +70,7 @@ class GenesisUltimatumEffect extends OneShotEffect { return false; } Cards toHand = new CardsImpl(player.getLibrary().getTopCards(game, 5)); -// player.lookAtCards("", toHand, game); + player.lookAtCards(source, null, toHand, game); TargetCard targetCard = new TargetCardInLibrary(0, 5, filter); player.choose(outcome, toHand, targetCard, game); Cards toBattlefield = new CardsImpl(targetCard.getTargets()); @@ -78,6 +79,7 @@ class GenesisUltimatumEffect extends OneShotEffect { .stream() .map(game::getPermanent) .map(MageItem::getId) + .filter(Objects::nonNull) // to prevent exception https://github.com/magefree/mage/issues/7220 .forEach(toHand::remove); } player.moveCards(toHand, Zone.HAND, source, game);