cziegeler commented on a change in pull request #11:
URL: 
https://github.com/apache/sling-org-apache-sling-jcr-resource/pull/11#discussion_r546400663



##########
File path: 
src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java
##########
@@ -358,8 +358,8 @@ public Resource 
getResource(ResolveContext<JcrProviderState> ctx, String path, R
                 if (version == null) {
                     String parentPath = 
ResourceUtil.getParent(child.getPath());
                     if (parentPath != null) {
-                        Item parentItem = 
ctx.getProviderState().getResourceFactory()
-                            .getItemOrNull(parentPath);
+                        Item parentItem = 
((JcrItemResource)child).getItem().getParent();

Review comment:
       getItem() as well as getParent might throw an exception - and will not 
return null, so I think the existing code is correct




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to