From e8ab8558d1c73311dafb8118f785597ee9aa0276 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 3 Oct 2016 22:07:10 +0200 Subject: [PATCH] Fixed some possible null pointer exceptions. --- Mage.Common/src/mage/view/PlayerView.java | 2 +- .../java/mage/abilities/effects/common/DynamicManaEffect.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Mage.Common/src/mage/view/PlayerView.java b/Mage.Common/src/mage/view/PlayerView.java index d64d2cb41e..9752a89a8d 100644 --- a/Mage.Common/src/mage/view/PlayerView.java +++ b/Mage.Common/src/mage/view/PlayerView.java @@ -125,7 +125,7 @@ public class PlayerView implements Serializable { } catch (ConcurrentModificationException e) { // can happen as a player left battlefield while PlayerView is created } - this.topCard = player.isTopCardRevealed() && player.getLibrary().size() > 0 + this.topCard = (player.isTopCardRevealed() && player.getLibrary().size() > 0) ? new CardView(player.getLibrary().getFromTop(game)) : null; if (player.getUserData() != null) { this.userData = player.getUserData(); diff --git a/Mage/src/main/java/mage/abilities/effects/common/DynamicManaEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DynamicManaEffect.java index 3ab765c7cc..7cfb211811 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DynamicManaEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DynamicManaEffect.java @@ -146,7 +146,7 @@ public class DynamicManaEffect extends BasicManaEffect { } else { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - ChoiceColor choiceColor = new ChoiceColor(); + ChoiceColor choiceColor = new ChoiceColor(true); for (int i = 0; i < count; i++) { if (!choiceColor.isChosen()) { while (!controller.choose(Outcome.Benefit, choiceColor, game)) {