You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "angela (JIRA)" <ji...@apache.org> on 2006/03/31 10:11:53 UTC

[jira] Resolved: (JCR-382) Setting WebDAV property without value causes NPE in DAVResourceImpl

     [ http://issues.apache.org/jira/browse/JCR-382?page=all ]
     
angela resolved JCR-382:
------------------------

    Fix Version: 1.0.1
     Resolution: Fixed

Thanks.
I applied the suggested with rev: 390356  

In addition i added a comment explaining the reasons for replacing a  'null' dav property value by empty string.



> 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