* Jeleva, Nephalia's Scourge and Knowledge Pool - Fixed a bug that created null pointer exception if card was cast from exile.

This commit is contained in:
LevelX2 2016-09-14 22:31:04 +02:00
parent 547d53a2ec
commit 14cd2dfa6d
3 changed files with 4 additions and 9 deletions

View file

@ -160,7 +160,6 @@ class JelevaNephaliasCastEffect extends OneShotEffect {
if (controller.choose(Outcome.PlayForFree, exileZone, target, game)) { if (controller.choose(Outcome.PlayForFree, exileZone, target, game)) {
Card card = game.getCard(target.getFirstTarget()); Card card = game.getCard(target.getFirstTarget());
if (card != null) { if (card != null) {
game.getExile().removeCard(card, game);
return controller.cast(card.getSpellAbility(), game, true); return controller.cast(card.getSpellAbility(), game, true);
} }
} }

View file

@ -178,7 +178,6 @@ class KnowledgePoolEffect2 extends OneShotEffect {
while (player.choose(Outcome.PlayForFree, game.getExile().getExileZone(exileZoneId), target, game)) { while (player.choose(Outcome.PlayForFree, game.getExile().getExileZone(exileZoneId), target, game)) {
Card card = game.getCard(target.getFirstTarget()); Card card = game.getCard(target.getFirstTarget());
if (card != null && !card.getId().equals(spell.getSourceId())) { if (card != null && !card.getId().equals(spell.getSourceId())) {
game.getExile().removeCard(card, game);
return player.cast(card.getSpellAbility(), game, true); return player.cast(card.getSpellAbility(), game, true);
} }
target.clearChosen(); target.clearChosen();

View file

@ -40,7 +40,6 @@ import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Random;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
import mage.ConditionalMana; import mage.ConditionalMana;
@ -83,7 +82,6 @@ import mage.actions.MageDrawAction;
import mage.cards.Card; import mage.cards.Card;
import mage.cards.Cards; import mage.cards.Cards;
import mage.cards.CardsImpl; import mage.cards.CardsImpl;
import mage.cards.MeldCard;
import mage.cards.SplitCard; import mage.cards.SplitCard;
import mage.cards.decks.Deck; import mage.cards.decks.Deck;
import mage.constants.AbilityType; import mage.constants.AbilityType;
@ -118,7 +116,6 @@ import mage.game.events.ZoneChangeEvent;
import mage.game.match.MatchPlayer; import mage.game.match.MatchPlayer;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentCard; import mage.game.permanent.PermanentCard;
import mage.game.permanent.PermanentMeld;
import mage.game.stack.Spell; import mage.game.stack.Spell;
import mage.game.stack.StackAbility; import mage.game.stack.StackAbility;
import mage.game.stack.StackObject; import mage.game.stack.StackObject;
@ -1852,7 +1849,7 @@ public abstract class PlayerImpl implements Player, Serializable {
returnCode = false; returnCode = false;
} }
} }
if(finalAmount > 0) { if (finalAmount > 0) {
game.fireEvent(GameEvent.getEvent(EventType.COUNTERS_ADDED, playerId, playerId, counter.getName(), amount)); game.fireEvent(GameEvent.getEvent(EventType.COUNTERS_ADDED, playerId, playerId, counter.getName(), amount));
} }
} else { } else {
@ -3161,9 +3158,9 @@ public abstract class PlayerImpl implements Player, Serializable {
if (permanent != null) { if (permanent != null) {
successfulMovedCards.add(permanent); successfulMovedCards.add(permanent);
if (!game.isSimulation()) { if (!game.isSimulation()) {
game.informPlayers(game.getPlayer(info.event.getPlayerId()) + " puts " + game.informPlayers(game.getPlayer(info.event.getPlayerId()) + " puts "
(info.faceDown ? "a card face down " : permanent.getLogName()) + " from " + + (info.faceDown ? "a card face down " : permanent.getLogName()) + " from "
fromZone.toString().toLowerCase(Locale.ENGLISH) + " onto the Battlefield"); + fromZone.toString().toLowerCase(Locale.ENGLISH) + " onto the Battlefield");
} }
} }
} }