You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ac...@apache.org on 2006/10/06 17:02:43 UTC

svn commit: r453629 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java

Author: aco
Date: Fri Oct  6 08:02:42 2006
New Revision: 453629

URL: http://svn.apache.org/viewvc?view=rev&rev=453629
Log:
Minor update: Check for null first before using the object.

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java?view=diff&rev=453629&r1=453628&r2=453629
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java (original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java Fri Oct  6 08:02:42 2006
@@ -581,12 +581,12 @@
         
         ConnectionState cs = lookupConnectionState(connectionId);
         SessionState session = cs.getSessionState(id);
-        
-        // Don't let new consumers or producers get added while we are closing this down.
-        session.shutdown();
-        
+
         if( session == null )
             throw new IllegalStateException("Cannot remove session that had not been registered: "+id);
+
+        // Don't let new consumers or producers get added while we are closing this down.
+        session.shutdown();
         
         // Cascade the connection stop to the consumers and producers.
         for (Iterator iter = session.getConsumerIds().iterator(); iter.hasNext();) {