mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Won't crash if precon deck didn't have the 'set' value
This commit is contained in:
@@ -77,17 +77,14 @@ public class PreconDeck implements InventoryItemFromSet {
|
|||||||
final Map<String, List<String>> sections = FileSection.parseSections(deckLines);
|
final Map<String, List<String>> sections = FileSection.parseSections(deckLines);
|
||||||
this.deck = Deck.fromSections(sections);
|
this.deck = Deck.fromSections(sections);
|
||||||
|
|
||||||
String setProxy = "n/a";
|
|
||||||
|
|
||||||
FileSection kv = FileSection.parse(sections.get("metadata"), "=");
|
FileSection kv = FileSection.parse(sections.get("metadata"), "=");
|
||||||
|
|
||||||
imageFilename = kv.get("Image");
|
imageFilename = kv.get("Image");
|
||||||
description = kv.get("Description");
|
description = kv.get("Description");
|
||||||
if (Singletons.getModel().getEditions().get(kv.get("set").toUpperCase()) != null) {
|
String deckEdition = kv.get("set");
|
||||||
setProxy = kv.get("set");
|
this.set = deckEdition == null || Singletons.getModel().getEditions().get(deckEdition.toUpperCase()) == null ? "n/a" : deckEdition;
|
||||||
}
|
|
||||||
|
|
||||||
this.set = setProxy;
|
|
||||||
this.recommendedDeals = new SellRules(sections.get("shop"));
|
this.recommendedDeals = new SellRules(sections.get("shop"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user