* Fixed some possible null pointer exceptions and some minor editing.

This commit is contained in:
LevelX2 2016-12-18 15:02:19 +01:00
parent 69b27f594a
commit da9e9a1180
4 changed files with 49 additions and 8 deletions

View file

@ -126,8 +126,9 @@ 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)
? new CardView(player.getLibrary().getFromTop(game)) : null;
Card cardOnTop = (player.isTopCardRevealed() && player.getLibrary().size() > 0)
? player.getLibrary().getFromTop(game) : null;
this.topCard = cardOnTop != null ? new CardView(cardOnTop) : null;
if (player.getUserData() != null) {
this.userData = player.getUserData();
} else {