mirror of
https://github.com/magefree/mage.git
synced 2025-12-30 07:22:03 -08:00
* Genesis Ultimatum - prevented possible exception during card moving (fixes #7220).
This commit is contained in:
parent
ed6bd4d7a7
commit
c82feb1b9d
1 changed files with 3 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue