You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by fm...@apache.org on 2008/02/04 14:05:58 UTC
svn commit: r618267 -
/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
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) {