incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r618267 - /incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
Date Mon, 04 Feb 2008 13:05:58 GMT
Author: fmeschbe
Date: Mon Feb  4 05:05:57 2008
New Revision: 618267

URL: http://svn.apache.org/viewvc?rev=618267&view=rev
Log:
Prevent NPE if the Sling main servlet is directly addressed and thus path info is null

Modified:
    incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java

Modified: incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java?rev=618267&r1=618266&r2=618267&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
(original)
+++ incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
Mon Feb  4 05:05:57 2008
@@ -76,6 +76,12 @@
 
     public Resource resolve(HttpServletRequest request) throws SlingException {
         String pathInfo = request.getPathInfo();
+        
+        // servlet directly address, so there is no path info, use "/" then
+        if (pathInfo == null) {
+            pathInfo = "/";
+        }
+        
         Resource result = resolve(pathInfo, request.getMethod());
 
         if (result == null) {



Mime
View raw message