fix NPE in viewimage

Caused by: java.lang.NullPointerException
	at net.yacy.peers.graphics.EncodedImage.<init>(EncodedImage.java:73)
	at ViewImage.respond(ViewImage.java:156)
pull/1/head
reger 10 years ago
parent 4ff018c9e4
commit d729386787

@ -152,9 +152,11 @@ public class ViewImage {
// read image
image = ImageParser.parse(urlString, imgb);
if (image == null || (auth && (width == 0 || height == 0) && maxwidth == 0 && maxheight == 0)) return ext == null ? image : new EncodedImage(image, ext, isStatic);
if (image == null) {
return null;
} else {
if ((auth && (width == 0 || height == 0) && maxwidth == 0 && maxheight == 0)) return ext == null ? image : new EncodedImage(image, ext, isStatic);
}
// find original size
final int h = image.getHeight(null);
final int w = image.getWidth(null);

Loading…
Cancel
Save