Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

NUTCH-862 HttpClient null pointer exception.

Andrzej Bialeckica94b10fea23
diff --git a/CHANGES.txt b/CHANGES.txt
index 14ec9344c..02b8e00e2 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -2,6 +2,8 @@ Nutch Change Log
Release 2.0 - Current Development
+* NUTCH-862 HttpClient null pointer exception (Sebastian Nagel via ab)
+
* NUTCH-904 "-resume" option is always processed as "false" in FetcherJob
(Faruk Berksöz via dogacan)
diff --git a/src/plugin/protocol-httpclient/src/java/org/apache/nutch/protocol/httpclient/HttpResponse.java b/src/plugin/protocol-httpclient/src/java/org/apache/nutch/protocol/httpclient/HttpResponse.java
index 318e13ee0..56687ad65 100644
--- a/src/plugin/protocol-httpclient/src/java/org/apache/nutch/protocol/httpclient/HttpResponse.java
+++ b/src/plugin/protocol-httpclient/src/java/org/apache/nutch/protocol/httpclient/HttpResponse.java
@@ -134,7 +134,9 @@ public class HttpResponse implements Response {
if (code == 200) throw new IOException(e.toString());
// for codes other than 200 OK, we are fine with empty content
} finally {
- in.close();
+ if (in != null) {
+ in.close();
+ }
get.abort();
}