Issue #1786 - fix null pointer
Change-Id: Ie7bf3aa9afe6a8dcd9d288afc0e6dc537fdf043d Former-commit-id:7701902083
[formerly 6f14dfd04a696c71e2b2c9d12b86549287e7f0de] Former-commit-id:6b909c7902
This commit is contained in:
parent
30e77171ab
commit
ad08e0a6ac
1 changed files with 42 additions and 10 deletions
|
@ -201,10 +201,18 @@ public class HttpClient {
|
|||
public void process(final HttpRequest request,
|
||||
final HttpContext context) throws HttpException,
|
||||
IOException {
|
||||
if (request.getFirstHeader("Content-Length") != null) {
|
||||
logBytes(
|
||||
Long.valueOf(request.getFirstHeader(
|
||||
"Content-Length").getValue()), 0);
|
||||
try {
|
||||
if (request != null
|
||||
&& request.getFirstHeader("Content-Length") != null) {
|
||||
logBytes(
|
||||
Long.valueOf(request.getFirstHeader(
|
||||
"Content-Length").getValue()),
|
||||
0);
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
statusHandler.handle(Priority.DEBUG,
|
||||
"Error in httpClient request interceptor",
|
||||
t);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -214,7 +222,18 @@ public class HttpClient {
|
|||
public void process(final HttpResponse response,
|
||||
final HttpContext context) throws HttpException,
|
||||
IOException {
|
||||
logBytes(0, response.getEntity().getContentLength());
|
||||
try {
|
||||
if (response != null
|
||||
&& response.getEntity() != null) {
|
||||
logBytes(0, response.getEntity()
|
||||
.getContentLength());
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
statusHandler
|
||||
.handle(Priority.DEBUG,
|
||||
"Error in httpsClient response interceptor",
|
||||
t);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -280,10 +299,16 @@ public class HttpClient {
|
|||
public void process(final HttpRequest request,
|
||||
final HttpContext context) throws HttpException,
|
||||
IOException {
|
||||
if (request.getFirstHeader("Content-Length") != null) {
|
||||
logBytes(
|
||||
Long.valueOf(request.getFirstHeader(
|
||||
"Content-Length").getValue()), 0);
|
||||
try {
|
||||
if (request != null
|
||||
&& request.getFirstHeader("Content-Length") != null) {
|
||||
logBytes(
|
||||
Long.valueOf(request.getFirstHeader(
|
||||
"Content-Length").getValue()), 0);
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
statusHandler.handle(Priority.DEBUG,
|
||||
"Error in httpClient request interceptor", t);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -293,7 +318,14 @@ public class HttpClient {
|
|||
public void process(final HttpResponse response,
|
||||
final HttpContext context) throws HttpException,
|
||||
IOException {
|
||||
logBytes(0, response.getEntity().getContentLength());
|
||||
try {
|
||||
if (response != null && response.getEntity() != null) {
|
||||
logBytes(0, response.getEntity().getContentLength());
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
statusHandler.handle(Priority.DEBUG,
|
||||
"Error in httpClient response interceptor", t);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue