fixed Kiora, Master of the Depths (NPE errors)

This commit is contained in:
Oleg Agafonov 2020-01-12 08:06:14 +04:00
parent 56d52899c8
commit aa678a3b00

View file

@ -143,14 +143,18 @@ class KioraRevealEffect extends OneShotEffect {
if (creatureCardFound) { if (creatureCardFound) {
TargetCard target = new TargetCardInLibrary(0, 1, creatureFilter); TargetCard target = new TargetCardInLibrary(0, 1, creatureFilter);
controller.chooseTarget(Outcome.DrawCard, cards, target, source, game); controller.chooseTarget(Outcome.DrawCard, cards, target, source, game);
cards.remove(target.getFirstTarget()); if (target.getFirstTarget() != null) {
cardsToHand.add(target.getFirstTarget()); cards.remove(target.getFirstTarget());
cardsToHand.add(target.getFirstTarget());
}
} }
if (landCardFound) { if (landCardFound) {
TargetCard target = new TargetCardInLibrary(0, 1, landFilter); TargetCard target = new TargetCardInLibrary(0, 1, landFilter);
controller.chooseTarget(Outcome.DrawCard, cards, target, source, game); controller.chooseTarget(Outcome.DrawCard, cards, target, source, game);
cards.remove(target.getFirstTarget()); if (target.getFirstTarget() != null) {
cardsToHand.add(target.getFirstTarget()); cards.remove(target.getFirstTarget());
cardsToHand.add(target.getFirstTarget());
}
} }
controller.moveCards(cardsToHand, Zone.HAND, source, game); controller.moveCards(cardsToHand, Zone.HAND, source, game);
controller.moveCards(cards, Zone.GRAVEYARD, source, game); controller.moveCards(cards, Zone.GRAVEYARD, source, game);