FIX for CustomCardReader to support instantiation when no custom edition has been found

This commit is contained in:
leriomaggio
2021-07-23 07:37:32 +01:00
parent 5b500bc568
commit 6be921c1a2

View File

@@ -28,11 +28,16 @@ public class CardDatabaseHelper {
private static void initialize() { private static void initialize() {
final CardStorageReader reader = new CardStorageReader(ForgeConstants.CARD_DATA_DIR, final CardStorageReader reader = new CardStorageReader(ForgeConstants.CARD_DATA_DIR,
null, false); null, false);
final CardStorageReader customReader = new CardStorageReader(ForgeConstants.USER_CUSTOM_CARDS_DIR, CardStorageReader customReader;
try {
customReader = new CardStorageReader(ForgeConstants.USER_CUSTOM_CARDS_DIR,
null, false); null, false);
} catch (Exception e) {
customReader = null;
}
staticData = new StaticData(reader, customReader, ForgeConstants.EDITIONS_DIR, staticData = new StaticData(reader, customReader, ForgeConstants.EDITIONS_DIR,
ForgeConstants.USER_CUSTOM_EDITIONS_DIR ,ForgeConstants.BLOCK_DATA_DIR, ForgeConstants.USER_CUSTOM_EDITIONS_DIR ,ForgeConstants.BLOCK_DATA_DIR,
"Latest", "Latest Art All Editions",
true, true,
false); false);
} }