mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Fixed NPE if no available sets to draft from in quest mode.
This commit is contained in:
@@ -747,9 +747,16 @@ public class QuestEventDraft {
|
|||||||
* @return The created draft or null in the event no draft could be created.
|
* @return The created draft or null in the event no draft could be created.
|
||||||
*/
|
*/
|
||||||
public static QuestEventDraft getRandomDraftOrNull(final QuestController quest) {
|
public static QuestEventDraft getRandomDraftOrNull(final QuestController quest) {
|
||||||
|
|
||||||
List<CardBlock> possibleBlocks = getAvailableBlocks(quest);
|
List<CardBlock> possibleBlocks = getAvailableBlocks(quest);
|
||||||
|
|
||||||
|
if (possibleBlocks == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
Collections.shuffle(possibleBlocks);
|
Collections.shuffle(possibleBlocks);
|
||||||
return getDraftOrNull(quest, possibleBlocks.get(0));
|
return getDraftOrNull(quest, possibleBlocks.get(0));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user