diff --git a/Mage.Client/src/main/java/org/mage/card/arcane/ManaSymbols.java b/Mage.Client/src/main/java/org/mage/card/arcane/ManaSymbols.java index be3ee0d570..c6be8e494b 100644 --- a/Mage.Client/src/main/java/org/mage/card/arcane/ManaSymbols.java +++ b/Mage.Client/src/main/java/org/mage/card/arcane/ManaSymbols.java @@ -1,6 +1,5 @@ package org.mage.card.arcane; -import mage.cards.repository.CardRepository; import mage.cards.repository.ExpansionRepository; import mage.client.dialog.PreferencesDialog; import mage.client.util.ImageHelper; @@ -51,6 +50,11 @@ public class ManaSymbols { } } List setCodes = ExpansionRepository.instance.getSetCodes(); + if (setCodes == null) { + // the cards db file is probaly not included in the client. It will be created after the first connect to a server. + log.warn("No db information for sets found. Connect to a server to create database file on client side. Then try to restart the client."); + return; + } for (String set : setCodes) { File file = new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET + set + "-C.jpg"); try { diff --git a/Mage/src/mage/cards/repository/ExpansionRepository.java b/Mage/src/mage/cards/repository/ExpansionRepository.java index e1520738a4..42781928b3 100644 --- a/Mage/src/mage/cards/repository/ExpansionRepository.java +++ b/Mage/src/mage/cards/repository/ExpansionRepository.java @@ -12,6 +12,7 @@ import java.sql.SQLException; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; +import org.apache.log4j.Logger; /** * @@ -20,7 +21,9 @@ import java.util.List; public enum ExpansionRepository { instance; - + + private static final Logger logger = Logger.getLogger(ExpansionRepository.class); + private static final String JDBC_URL = "jdbc:h2:file:./db/cards.h2;AUTO_SERVER=TRUE"; private static final String VERSION_ENTITY_NAME = "expansion"; private static final long EXPANSION_DB_VERSION = 3; @@ -63,6 +66,8 @@ public enum ExpansionRepository { setCodes.add(expansion.getCode()); } } catch (SQLException ex) { + logger.error("Can't get the expansion set codes from database.", ex); + return setCodes; } return setCodes; }