Fixed NPE errors for some cards (#5471)

This commit is contained in:
Oleg Agafonov 2019-01-07 14:04:33 +04:00
parent cbfdcd12c1
commit 8c7df840f3
21 changed files with 136 additions and 186 deletions

View file

@ -186,7 +186,9 @@ public class Library implements Serializable {
Map<String, Card> cards = new HashMap<>();
for (UUID cardId : library) {
Card card = game.getCard(cardId);
cards.putIfAbsent(card.getName(), card);
if (card != null) {
cards.putIfAbsent(card.getName(), card);
}
}
return cards.values();
}