diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/draft2/builder/DraftChoiceBuilder.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/draft2/builder/DraftChoiceBuilder.java index 83c333dd3..a192f3f10 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/draft2/builder/DraftChoiceBuilder.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/draft2/builder/DraftChoiceBuilder.java @@ -72,8 +72,9 @@ public class DraftChoiceBuilder { public CardCollection getCardsForChoiceId(String choiceId, long seed, int stage) { List cardIds = cardsMap.get(choiceId); DefaultCardCollection cardCollection = new DefaultCardCollection(); - for (String cardId : cardIds) - cardCollection.addItem(cardId, 1); + if (cardIds != null) + for (String cardId : cardIds) + cardCollection.addItem(cardId, 1); return cardCollection; } @@ -95,7 +96,7 @@ public class DraftChoiceBuilder { final List shuffledCards = getShuffledCards(seed, stage); List draftableCards = new ArrayList(count); - for (int i=0; i shuffledCards = getShuffledCards(seed, stage); - for (int i=0; i availableChoices = soloDraft.getAvailableChoices(0, 0); + String choiceId = availableChoices.iterator().next().getChoiceId(); + + CardCollection firstPickCards = soloDraft.getCardsForChoiceId(choiceId, 0, 0); + assertFalse(firstPickCards.getAll().isEmpty()); + + assertTrue(soloDraft.getCardsForChoiceId("madeUpChoiceId", 0, 0).getAll().isEmpty()); + + assertTrue(soloDraft.hasNextStage(0, 1)); + Iterable secondChoices = soloDraft.getAvailableChoices(0, 1); + String secondChoiceId = secondChoices.iterator().next().getChoiceId(); + + assertFalse(soloDraft.getCardsForChoiceId(secondChoiceId, 0, 1).getAll().isEmpty()); + assertTrue(soloDraft.getCardsForChoiceId("madeUpChoiceId", 0, 1).getAll().isEmpty()); + } +} \ No newline at end of file