Fixed some possible null pointer exceptions.

This commit is contained in:
LevelX2 2016-10-03 22:07:10 +02:00
parent 01ca3689b3
commit e8ab8558d1
2 changed files with 2 additions and 2 deletions

View file

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

View file

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