HTTPCLIENT-1544: Fixed NPE in ResponseProcessCookies when running with DEBUG priority

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1618328 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2014-08-16 11:06:55 +00:00
parent 683bb070fd
commit e8dbce5f9b
1 changed files with 5 additions and 3 deletions

View File

@ -138,10 +138,12 @@ public class ResponseProcessCookies implements HttpResponseInterceptor {
buf.append(cookie.getName());
buf.append("=\"");
String v = cookie.getValue();
if (v.length() > 100) {
v = v.substring(0, 100) + "...";
if (v != null) {
if (v.length() > 100) {
v = v.substring(0, 100) + "...";
}
buf.append(v);
}
buf.append(v);
buf.append("\"");
buf.append(", version:");
buf.append(Integer.toString(cookie.getVersion()));