Merge pull request #2002 from draxdyn/getwizardsimage_npe

Fix NPE in getWizardsCard
This commit is contained in:
spjspj 2016-06-16 12:16:02 +10:00 committed by GitHub
commit 8c017fe3d2

View file

@ -184,7 +184,7 @@ public class ImageCache {
}
public static BufferedImage getWizardsCard(BufferedImage image) {
if (image.getWidth() == 265 && image.getHeight() == 370) {
if (image != null && image.getWidth() == 265 && image.getHeight() == 370) {
BufferedImage crop = new BufferedImage(256, 360, BufferedImage.TYPE_INT_RGB);
Graphics2D graphics2D = crop.createGraphics();
graphics2D.drawImage(image, 0, 0, 255, 360, 5, 5, 261, 365, null);