tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r494020 - in /incubator/tuscany/java/sca/runtime/webapp/webapp-api/src: main/java/org/apache/tuscany/runtime/webapp/TuscanySessionListener.java test/java/org/apache/tuscany/runtime/webapp/TuscanySessionListenerTestCase.java
Date Mon, 08 Jan 2007 10:54:02 GMT
Author: antelder
Date: Mon Jan  8 02:54:01 2007
New Revision: 494020

URL: http://svn.apache.org/viewvc?view=rev&rev=494020
Log:
TUSCANY-700, fix NPE if session destroyed before runtime is created

Modified:
    incubator/tuscany/java/sca/runtime/webapp/webapp-api/src/main/java/org/apache/tuscany/runtime/webapp/TuscanySessionListener.java
    incubator/tuscany/java/sca/runtime/webapp/webapp-api/src/test/java/org/apache/tuscany/runtime/webapp/TuscanySessionListenerTestCase.java

Modified: incubator/tuscany/java/sca/runtime/webapp/webapp-api/src/main/java/org/apache/tuscany/runtime/webapp/TuscanySessionListener.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/webapp/webapp-api/src/main/java/org/apache/tuscany/runtime/webapp/TuscanySessionListener.java?view=diff&rev=494020&r1=494019&r2=494020
==============================================================================
--- incubator/tuscany/java/sca/runtime/webapp/webapp-api/src/main/java/org/apache/tuscany/runtime/webapp/TuscanySessionListener.java
(original)
+++ incubator/tuscany/java/sca/runtime/webapp/webapp-api/src/main/java/org/apache/tuscany/runtime/webapp/TuscanySessionListener.java
Mon Jan  8 02:54:01 2007
@@ -46,7 +46,8 @@
     }
 
     public void sessionDestroyed(HttpSessionEvent event) {
-        runtime.sessionDestroyed(event);
-
+        if (runtime != null) {
+            runtime.sessionDestroyed(event);
+        }
     }
 }

Modified: incubator/tuscany/java/sca/runtime/webapp/webapp-api/src/test/java/org/apache/tuscany/runtime/webapp/TuscanySessionListenerTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/webapp/webapp-api/src/test/java/org/apache/tuscany/runtime/webapp/TuscanySessionListenerTestCase.java?view=diff&rev=494020&r1=494019&r2=494020
==============================================================================
--- incubator/tuscany/java/sca/runtime/webapp/webapp-api/src/test/java/org/apache/tuscany/runtime/webapp/TuscanySessionListenerTestCase.java
(original)
+++ incubator/tuscany/java/sca/runtime/webapp/webapp-api/src/test/java/org/apache/tuscany/runtime/webapp/TuscanySessionListenerTestCase.java
Mon Jan  8 02:54:01 2007
@@ -52,4 +52,9 @@
         listener.sessionCreated(event);
         EasyMock.verify(context);
     }
+
+    public void testSessionDestroyedBeforeCreated() throws Exception {
+        TuscanySessionListener listener = new TuscanySessionListener();
+        listener.sessionDestroyed(null);
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message