From 4d6c70e390fbcb6830e3287ead349afe4cd3419c Mon Sep 17 00:00:00 2001 From: magenoxx <magenoxx@gmail> Date: Sat, 30 Oct 2010 17:37:01 +0000 Subject: [PATCH] Not sure this is correct handling, but spent 2h because of missing exception in the logs when jar is missing or path is not correct. --- .../java/mage/client/util/ImageHelper.java | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/util/ImageHelper.java b/Mage.Client/src/main/java/mage/client/util/ImageHelper.java index 65611edb78..2ef6fceed1 100644 --- a/Mage.Client/src/main/java/mage/client/util/ImageHelper.java +++ b/Mage.Client/src/main/java/mage/client/util/ImageHelper.java @@ -112,13 +112,19 @@ public class ImageHelper { } if (card.getExpansionSetCode() != null && card.getExpansionSetCode().length() > 0 && card.getRarity() != null && card.getRarity() != Rarity.NA) { - String symbolCode = Sets.getInstance().get(card.getExpansionSetCode()).getSymbolCode(); - if (symbolCode != null && symbolCode.length() > 0) { - StringBuilder sb = new StringBuilder(); - sb.append(Config.setIconsResourcePath).append("graphic_").append(symbolCode).append("_").append(card.getRarity().getSymbolCode()).append(".png"); - BufferedImage icon = loadImage(sb.toString(), ICON_MAX_HEIGHT); - if (icon != null) - g.drawImage(icon, ICON_MAX_XOFFSET - icon.getWidth(), ICON_MAX_YOFFSET, null); + try { + String symbolCode = Sets.getInstance().get(card.getExpansionSetCode()).getSymbolCode(); + if (symbolCode != null && symbolCode.length() > 0) { + StringBuilder sb = new StringBuilder(); + sb.append(Config.setIconsResourcePath).append("graphic_").append(symbolCode).append("_").append(card.getRarity().getSymbolCode()).append(".png"); + BufferedImage icon = loadImage(sb.toString(), ICON_MAX_HEIGHT); + if (icon != null) + g.drawImage(icon, ICON_MAX_XOFFSET - icon.getWidth(), ICON_MAX_YOFFSET, null); + } + } catch (Exception e) { + e.printStackTrace(); + } catch (Error er) { + er.printStackTrace(); } }