- A better fix for the custom booster draft NPEing

This commit is contained in:
Agetian
2014-01-27 07:06:20 +00:00
parent f5d43d0986
commit 8dea53bcda
2 changed files with 8 additions and 1 deletions

View File

@@ -134,7 +134,10 @@ public class ImageCache {
* </p> * </p>
*/ */
public static BufferedImage getOriginalImage(String imageKey, boolean useDefaultIfNotFound) { public static BufferedImage getOriginalImage(String imageKey, boolean useDefaultIfNotFound) {
if (null == imageKey) {
return null;
}
boolean altState = imageKey.endsWith(ImageKeys.BACKFACE_POSTFIX); boolean altState = imageKey.endsWith(ImageKeys.BACKFACE_POSTFIX);
if(altState) if(altState)
imageKey = imageKey.substring(0, imageKey.length() - ImageKeys.BACKFACE_POSTFIX.length()); imageKey = imageKey.substring(0, imageKey.length() - ImageKeys.BACKFACE_POSTFIX.length());

View File

@@ -45,6 +45,10 @@ public enum CDetail implements ICDoc {
* @param c &emsp; Card object * @param c &emsp; Card object
*/ */
public void showCard(final Card c) { public void showCard(final Card c) {
if (null == c) {
return;
}
view.getLblFlipcard().setVisible(c != null && (c.isDoubleFaced() || c.isFlipCard() || c.isFaceDown() && Singletons.getControl().mayShowCard(c))); view.getLblFlipcard().setVisible(c != null && (c.isDoubleFaced() || c.isFlipCard() || c.isFaceDown() && Singletons.getControl().mayShowCard(c)));
view.getPnlDetail().setCard(c); view.getPnlDetail().setCard(c);
view.getParentCell().repaintSelf(); view.getParentCell().repaintSelf();