Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

fix NPE in viewimage

regerd72938678776
diff --git a/htroot/ViewImage.java b/htroot/ViewImage.java
index eed6dfc33..d07cfae3c 100644
--- a/htroot/ViewImage.java
+++ b/htroot/ViewImage.java
@@ -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);