From 687fe91f496f998915d610d53381d0101e13ef0c Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 18 Feb 2015 09:11:33 +0100 Subject: [PATCH] * Fixed possible null pointer exception. --- Mage/src/mage/game/permanent/PermanentCard.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Mage/src/mage/game/permanent/PermanentCard.java b/Mage/src/mage/game/permanent/PermanentCard.java index 1c9910abac..82ec080216 100644 --- a/Mage/src/mage/game/permanent/PermanentCard.java +++ b/Mage/src/mage/game/permanent/PermanentCard.java @@ -138,7 +138,9 @@ public class PermanentCard extends PermanentImpl { Card originalCard = game.getCard(this.getId()); if (isFaceDown()) { setFaceDown(false); - originalCard.setFaceDown(false); //TODO: Do this in a better way + if (originalCard != null) { + originalCard.setFaceDown(false); //TODO: Do this in a better way + } } ZoneChangeEvent event = new ZoneChangeEvent(this, sourceId, controllerId, fromZone, toZone, appliedEffects); if (!game.replaceEvent(event)) { @@ -146,7 +148,9 @@ public class PermanentCard extends PermanentImpl { game.rememberLKI(objectId, Zone.BATTLEFIELD, this); if (owner != null) { this.setControllerId(ownerId); // neccessary for e.g. abilities in graveyard or hand to not have a controller != owner - originalCard.updateZoneChangeCounter(); + if (originalCard != null) { + originalCard.updateZoneChangeCounter(); + } switch (event.getToZone()) { case GRAVEYARD: owner.putInGraveyard(card, game, !flag);