You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2013/04/30 18:48:45 UTC

svn commit: r1477722 - /sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java

Author: cziegeler
Date: Tue Apr 30 16:48:44 2013
New Revision: 1477722

URL: http://svn.apache.org/r1477722
Log:
SLING-2703 : [SlingPostServlet] PathNotFoundException logged when uploading file using slingpostservlet

Modified:
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java?rev=1477722&r1=1477721&r2=1477722&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java (original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java Tue Apr 30 16:48:44 2013
@@ -275,7 +275,10 @@ public class JcrNodeResource extends Jcr
 
                 // continue our stuff with the jcr:content node
                 // which might be nt:resource, which we support below
-                node = node.getNode(JCR_CONTENT);
+                // if the node is new, the content node might not exist yet
+                if ( !node.isNew() || node.hasNode(JCR_CONTENT) ) {
+                    node = node.getNode(JCR_CONTENT);
+                }
             }
 
             // check stuff for nt:resource (or similar) nodes