jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r1232100 - /jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/ValueLoader.java
Date Mon, 16 Jan 2012 18:28:21 GMT
Author: tripod
Date: Mon Jan 16 18:28:20 2012
New Revision: 1232100

URL: http://svn.apache.org/viewvc?rev=1232100&view=rev
Log:
JCR-3210 NPE in spi2dav when server does not send all headers

Modified:
    jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/ValueLoader.java

Modified: jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/ValueLoader.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/ValueLoader.java?rev=1232100&r1=1232099&r2=1232100&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/ValueLoader.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/ValueLoader.java
Mon Jan 16 18:28:20 2012
@@ -16,6 +16,7 @@
  */
 package org.apache.jackrabbit.spi2davex;
 
+import org.apache.commons.httpclient.Header;
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.methods.GetMethod;
 import org.apache.commons.httpclient.methods.HeadMethod;
@@ -74,7 +75,10 @@ class ValueLoader {
             if (statusCode == DavServletResponse.SC_OK) {
                 Map<String, String> headers = new HashMap<String, String>();
                 for (String name : headerNames) {
-                    headers.put(name, method.getResponseHeader(name).getValue());
+                    Header hdr = method.getResponseHeader(name);
+                    if (hdr != null) {
+                        headers.put(name, hdr.getValue());
+                    }
                 }
                 return headers;
             } else {



Mime
View raw message