NPE trying to scale a missing image

This commit is contained in:
Maxmtg
2013-02-21 09:00:21 +00:00
parent adc1fa3ae6
commit 97d57fb05c

View File

@@ -88,8 +88,10 @@ public class ImageCache {
} }
boolean mayEnlarge = Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_SCALE_LARGER); boolean mayEnlarge = Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_SCALE_LARGER);
BufferedImage original = getImage(key); BufferedImage original = getImage(key);
if ( null == original )
return null;
double scale = Math.min((double) width / original.getWidth(), (double) height / original.getHeight()); double scale = Math.min((double) width / original.getWidth(), (double) height / original.getHeight());
// here would be the place to limit the scaling option in menu ? // here would be the place to limit the scaling option in menu ?
if ((scale > 1) && !mayEnlarge) { if ((scale > 1) && !mayEnlarge) {