[ http://issues.apache.org/jira/browse/JCR-382?page=comments#action_12413333 ]
Jukka Zitting commented on JCR-382: ----------------------------------- Merged for 1.0.1 in revision 409537. > Setting WebDAV property without value causes NPE in DAVResourceImpl > ------------------------------------------------------------------- > > Key: JCR-382 > URL: http://issues.apache.org/jira/browse/JCR-382 > Project: Jackrabbit > Type: Bug > Components: webdav > Versions: 1.0 > Reporter: Rob Owen > Assignee: angela > Fix For: 1.0.1 > > A WebDAV PROPPATCH of a property without a value <prf:SomeProperty/> causes a > NPE in DAVResourceImpl when the value is retrieved and the toString() method > called on it. Here is a patch that works around the problem. > Index: > C:/jprojects/eclipse/jackrabbit/jcr-server/server/src/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java > =================================================================== > --- > C:/jprojects/eclipse/jackrabbit/jcr-server/server/src/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java > (revision 388517) > +++ > C:/jprojects/eclipse/jackrabbit/jcr-server/server/src/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java > (working copy) > @@ -930,7 +930,10 @@ > */ > private void setJcrProperty(DavProperty property) throws > RepositoryException { > // retrieve value > - String value = property.getValue().toString(); > + String value = ""; > + if (property.getValue() != null) { > + value = property.getValue().toString(); > + } > // set value; since multivalued-properties are not listed in the set > // of available properties, this extra validation-check is omitted. > node.setProperty(getJcrName(property.getName()), value); -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
