You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2014/08/16 13:06:26 UTC

svn commit: r1618327 - /httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/client/protocol/ResponseProcessCookies.java

Author: olegk
Date: Sat Aug 16 11:06:26 2014
New Revision: 1618327

URL: http://svn.apache.org/r1618327
Log:
HTTPCLIENT-1544: Fixed NPE in ResponseProcessCookies when running with DEBUG priority

Modified:
    httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/client/protocol/ResponseProcessCookies.java

Modified: httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/client/protocol/ResponseProcessCookies.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/client/protocol/ResponseProcessCookies.java?rev=1618327&r1=1618326&r2=1618327&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/client/protocol/ResponseProcessCookies.java (original)
+++ httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/client/protocol/ResponseProcessCookies.java Sat Aug 16 11:06:26 2014
@@ -137,10 +137,12 @@ public class ResponseProcessCookies impl
         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()));