* Fixed possible null pointer exception.

This commit is contained in:
LevelX2 2015-02-18 09:11:33 +01:00
parent 3ba5d70d2f
commit 687fe91f49

View file

@ -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);