incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r1057478 - /sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/webapp/SlingSessionListener.java
Date Tue, 11 Jan 2011 03:36:54 GMT
Author: fmeschbe
Date: Tue Jan 11 03:36:53 2011
New Revision: 1057478

URL: http://svn.apache.org/viewvc?rev=1057478&view=rev
Log:
Prevent a NullPointerException while setting up the proxy (actually when creating the ServletContextEvent
to setup the proxy with) if the SlingSessionListener has not been configured in the web application.

Modified:
    sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/webapp/SlingSessionListener.java

Modified: sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/webapp/SlingSessionListener.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/webapp/SlingSessionListener.java?rev=1057478&r1=1057477&r2=1057478&view=diff
==============================================================================
--- sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/webapp/SlingSessionListener.java
(original)
+++ sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/webapp/SlingSessionListener.java
Tue Jan 11 03:36:53 2011
@@ -40,6 +40,14 @@ public class SlingSessionListener implem
     private static HttpSessionAttributeListener delegateeSessionAttributeListener;
 
     static void startDelegate(final ClassLoader classLoader) {
+
+        // if the listener has not been configured, do nothing because
+        // there is no servlet context to forward and there are no
+        // events ever sent to this listener
+        if (servletContext == null) {
+            return;
+        }
+
         Object delegatee = null;
         try {
             Class<?> delegateeClass = classLoader.loadClass(SharedConstants.DEFAULT_SLING_LISTENER);



Mime
View raw message