* Genesis Ultimatum - prevented possible exception during card moving (fixes
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);
