From aa678a3b00073102783669b6c03548d6a9c76132 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Sun, 12 Jan 2020 08:06:14 +0400 Subject: [PATCH] fixed Kiora, Master of the Depths (NPE errors) --- .../src/mage/cards/k/KioraMasterOfTheDepths.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Mage.Sets/src/mage/cards/k/KioraMasterOfTheDepths.java b/Mage.Sets/src/mage/cards/k/KioraMasterOfTheDepths.java index 8ec26ee632..6b0e75a0bb 100644 --- a/Mage.Sets/src/mage/cards/k/KioraMasterOfTheDepths.java +++ b/Mage.Sets/src/mage/cards/k/KioraMasterOfTheDepths.java @@ -143,14 +143,18 @@ class KioraRevealEffect extends OneShotEffect { if (creatureCardFound) { TargetCard target = new TargetCardInLibrary(0, 1, creatureFilter); controller.chooseTarget(Outcome.DrawCard, cards, target, source, game); - cards.remove(target.getFirstTarget()); - cardsToHand.add(target.getFirstTarget()); + if (target.getFirstTarget() != null) { + cards.remove(target.getFirstTarget()); + cardsToHand.add(target.getFirstTarget()); + } } if (landCardFound) { TargetCard target = new TargetCardInLibrary(0, 1, landFilter); controller.chooseTarget(Outcome.DrawCard, cards, target, source, game); - cards.remove(target.getFirstTarget()); - cardsToHand.add(target.getFirstTarget()); + if (target.getFirstTarget() != null) { + cards.remove(target.getFirstTarget()); + cardsToHand.add(target.getFirstTarget()); + } } controller.moveCards(cardsToHand, Zone.HAND, source, game); controller.moveCards(cards, Zone.GRAVEYARD, source, game);