incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r611812 - /incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/SlingServletResolver.java
Date Mon, 14 Jan 2008 14:25:15 GMT
Author: bdelacretaz
Date: Mon Jan 14 06:25:13 2008
New Revision: 611812

URL: http://svn.apache.org/viewvc?rev=611812&view=rev
Log:
Avoid NPE in resolveServletOrScript if Resource is null (might happen while handling errors)

Modified:
    incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/SlingServletResolver.java

Modified: incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/SlingServletResolver.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/SlingServletResolver.java?rev=611812&r1=611811&r2=611812&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/SlingServletResolver.java
(original)
+++ incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/SlingServletResolver.java
Mon Jan 14 06:25:13 2008
@@ -238,6 +238,11 @@
 
     Servlet resolveServletOrScript(SlingHttpServletRequest request) {
 
+        // if handling errors, resource might be null
+        if(request.getResource() == null) {
+            return null;
+        }
+        
         // get the servlet by resource type
         Servlet servlet = getServlet(request.getResource().getResourceType());
         if (servlet != null) {



Mime
View raw message