mirror of
https://github.com/apache/httpcomponents-client.git
synced 2025-02-19 08:31:37 +00:00
Not sure that instream can be null, but assuming it can, there's no point entering the try block if it's null. This avoids NPE warning
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1206734 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6921a32fa6
commit
8f91869343
@ -139,18 +139,18 @@ public void run() {
|
||||
HttpEntity entity = response.getEntity();
|
||||
if (entity != null) {
|
||||
InputStream instream = entity.getContent();
|
||||
try {
|
||||
contentLen = 0;
|
||||
if (instream != null) {
|
||||
try {
|
||||
int l = 0;
|
||||
while ((l = instream.read(buffer)) != -1) {
|
||||
contentLen += l;
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
instream.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (response.getStatusLine().getStatusCode() == 200) {
|
||||
this.stats.success(contentLen);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user