You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by re...@apache.org on 2024/07/16 15:20:23 UTC

(sling-org-apache-sling-resourceresolver) branch SLING-12383 created (now a43e6ce)

This is an automated email from the ASF dual-hosted git repository.

reschke pushed a change to branch SLING-12383
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resourceresolver.git


      at a43e6ce  SLING-12383: ResourceResolver: potential NPE while processing aliases

This branch includes the following new commits:

     new a43e6ce  SLING-12383: ResourceResolver: potential NPE while processing aliases

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(sling-org-apache-sling-resourceresolver) 01/01: SLING-12383: ResourceResolver: potential NPE while processing aliases

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

reschke pushed a commit to branch SLING-12383
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resourceresolver.git

commit a43e6cedd8346461350dfcb4d2cadba902e965f7
Author: Julian Reschke <re...@apache.org>
AuthorDate: Tue Jul 16 16:20:08 2024 +0100

    SLING-12383: ResourceResolver: potential NPE while processing aliases
---
 .../org/apache/sling/resourceresolver/impl/mapping/MapEntries.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java
index ee62ea1..19d6a8f 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java
@@ -1224,10 +1224,15 @@ public class MapEntries implements
             containingResource = resource;
         }
 
+        if (containingResource == null) {
+            log.warn("containingResource is null for alias on {}, skipping.", resource.getPath());
+            return false;
+        }
+ 
         final Resource parent = containingResource.getParent();
 
         if (parent == null) {
-            log.debug("parent is null for alias on {}.", resource.getName());
+            log.warn("parent is null for alias on {}, skipping.", resource.getPath());
             return false;
         }
         else {