jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r390356 - /jackrabbit/trunk/jcr-server/server/src/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java
Date Fri, 31 Mar 2006 08:06:51 GMT
Author: angela
Date: Fri Mar 31 00:06:40 2006
New Revision: 390356

URL: http://svn.apache.org/viewcvs?rev=390356&view=rev
Log:
JCR-382: Setting WebDAV property without value causes NPE in DAVResourceImpl

Modified:
    jackrabbit/trunk/jcr-server/server/src/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java

Modified: jackrabbit/trunk/jcr-server/server/src/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java
URL: http://svn.apache.org/viewcvs/jackrabbit/trunk/jcr-server/server/src/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java?rev=390356&r1=390355&r2=390356&view=diff
==============================================================================
--- jackrabbit/trunk/jcr-server/server/src/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java
(original)
+++ jackrabbit/trunk/jcr-server/server/src/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java
Fri Mar 31 00:06:40 2006
@@ -929,10 +929,13 @@
      * @throws RepositoryException
      */
     private void setJcrProperty(DavProperty property) throws RepositoryException {
-        // retrieve value
-        String value = property.getValue().toString();
-        // set value; since multivalued-properties are not listed in the set
-        // of available properties, this extra validation-check is omitted.
+        // Retrieve the property value. Note, that a 'null' value is replaced
+        // by empty string, since setting a jcr property value to 'null'
+        // would be equivalent to its removal.
+        String value = "";
+        if (property.getValue() != null) {
+            value = property.getValue().toString();
+        }
         node.setProperty(getJcrName(property.getName()), value);
     }
 



Mime
View raw message