mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Forge will no longer crash when there are decks with unsupported cards. These cards will appear in decks and games player starts as a dummy without cost, types, abilities, but with explanation in card's text
This commit is contained in:
@@ -144,6 +144,9 @@ public class ImageCache {
|
||||
if (imageKey.startsWith(ImageKeys.CARD_PREFIX))
|
||||
imageKey = getImageKey(getPaperCardFromImageKey(imageKey.substring(2)), altState, true);
|
||||
|
||||
if (StringUtils.isBlank(imageKey)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Load from file and add to cache if not found in cache initially.
|
||||
BufferedImage original = getImage(imageKey);
|
||||
@@ -153,7 +156,7 @@ public class ImageCache {
|
||||
if (original == null) {
|
||||
if (useDefaultIfNotFound) {
|
||||
original = _defaultImage;
|
||||
_CACHE.put(imageKey, _defaultImage);
|
||||
_CACHE.put(imageKey, _defaultImage);
|
||||
} else {
|
||||
original = null;
|
||||
}
|
||||
@@ -243,7 +246,7 @@ public class ImageCache {
|
||||
|
||||
|
||||
private static String getImageRelativePath(PaperCard cp, boolean backFace, boolean includeSet, boolean isDownloadUrl) {
|
||||
final String nameToUse = getNameToUse(cp, backFace);
|
||||
final String nameToUse = cp == null ? null : getNameToUse(cp, backFace);
|
||||
if ( null == nameToUse )
|
||||
return null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user