incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r896833 - /sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingMainServlet.java
Date Thu, 07 Jan 2010 10:18:34 GMT
Author: cziegeler
Date: Thu Jan  7 10:17:46 2010
New Revision: 896833

URL: http://svn.apache.org/viewvc?rev=896833&view=rev
Log:
SLING-1275 : Return value of ComponentContext#locateContext should be checked for null value

Modified:
    sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingMainServlet.java

Modified: sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingMainServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingMainServlet.java?rev=896833&r1=896832&r2=896833&view=diff
==============================================================================
--- sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingMainServlet.java
(original)
+++ sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingMainServlet.java
Thu Jan  7 10:17:46 2010
@@ -20,6 +20,7 @@
 
 import static org.apache.sling.api.SlingConstants.ERROR_REQUEST_URI;
 import static org.apache.sling.api.SlingConstants.ERROR_SERVLET_NAME;
+
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.net.SocketException;
@@ -681,7 +682,10 @@
     }
 
     private void initFilter(ComponentContext osgiContext, ServiceReference ref) {
-        Filter filter = (Filter) osgiContext.locateService(FILTER_NAME, ref);
+        final Filter filter = (Filter) osgiContext.locateService(FILTER_NAME, ref);
+        if ( filter == null ) {
+            return;
+        }
 
         // require a name for the filter
         String filterName = AbstractServiceReferenceConfig.getName(ref);



Mime
View raw message