Skip to content

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

change for problem with NPE (seen as "PROXY Unknown Error while processing request")

danielrec84a52adb1b
diff --git a/source/de/anomic/http/JakartaCommonsHttpResponse.java b/source/de/anomic/http/JakartaCommonsHttpResponse.java
index 65dd4cb33..e0050ab4d 100644
--- a/source/de/anomic/http/JakartaCommonsHttpResponse.java
+++ b/source/de/anomic/http/JakartaCommonsHttpResponse.java
@@ -118,11 +118,15 @@ public class JakartaCommonsHttpResponse {
*/
public InputStream getDataAsStream() throws IOException {
InputStream inStream = method.getResponseBodyAsStream();
- if (getResponseHeader().gzip()) {
- inStream = new GZIPInputStream(inStream);
+ if(inStream != null) {
+ if (getResponseHeader().gzip()) {
+ inStream = new GZIPInputStream(inStream);
+ }
+ // count bytes for overall http-statistics
+ return new httpdByteCountInputStream(inStream, incomingAccountingName);
+ } else {
+ return null;
}
- // count bytes for overall http-statistics
- return new httpdByteCountInputStream(inStream, incomingAccountingName);
}
/*