Added test and fixed some possible null pointer exception.

This commit is contained in:
LevelX2 2016-10-22 12:45:50 +02:00
parent 13c8f3263f
commit bf43ea9936
10 changed files with 130 additions and 31 deletions

View file

@ -193,8 +193,11 @@ public abstract class ExpansionSet implements Serializable {
if (15 > theBooster.size()) {
List<CardInfo> commons = getCardsByRarity(Rarity.COMMON);
while (15 > theBooster.size()) {
while (15 > theBooster.size() && !commons.isEmpty()) {
addToBooster(theBooster, commons);
if (commons.isEmpty()) {
commons = getCardsByRarity(Rarity.COMMON);
}
}
}