Author: bdelacretaz
Date: Thu Oct 13 13:18:48 2016
New Revision: 1764666

URL: http://svn.apache.org/viewvc?rev=1764666&view=rev
Log:
SLING-6147 - getting null Resource here, should not happen but it's good to 
detect

Modified:
    
sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java

Modified: 
sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java?rev=1764666&r1=1764665&r2=1764666&view=diff
==============================================================================
--- 
sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java
 (original)
+++ 
sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java
 Thu Oct 13 13:18:48 2016
@@ -957,6 +957,10 @@ public class MapEntries implements Resou
      * @return {@code true} if this is valid, {@code false} otherwise
      */
     private boolean isValidVanityPath(Resource resource){
+        if(resource == null) {
+            throw new IllegalArgumentException("Unexpected null resource");
+        }
+        
         // ignore system tree
         if (resource.getPath().startsWith(JCR_SYSTEM_PREFIX)) {
             log.debug("isValidVanityPath: not valid {}", resource);


Reply via email to