activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/2] activemq-artemis git commit: ARTEMIS-1389 Add non-null check to ServerSessionImpl.doClose()
Date Tue, 05 Sep 2017 20:17:12 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 3497ae81f -> cc35b2361


ARTEMIS-1389 Add non-null check to ServerSessionImpl.doClose()

An Openwire connection creates an internal session used to track
transaction status, it doesn't have a session callback. When
the connection is closed, the core session should check if
callback is null to avoid NPE.


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/cd551bfb
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/cd551bfb
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/cd551bfb

Branch: refs/heads/master
Commit: cd551bfba07ca8383bc4e738dee4dc2964a1bc6d
Parents: 3497ae8
Author: Howard Gao <howard.gao@gmail.com>
Authored: Mon Sep 4 18:56:57 2017 +0800
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Tue Sep 5 16:16:33 2017 -0400

----------------------------------------------------------------------
 .../activemq/artemis/core/server/impl/ServerSessionImpl.java     | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/cd551bfb/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
index 7f09887..4d28fc7 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
@@ -348,7 +348,9 @@ public class ServerSessionImpl implements ServerSession, FailureListener
{
    }
 
    protected void doClose(final boolean failed) throws Exception {
-      callback.close(failed);
+      if (callback != null) {
+         callback.close(failed);
+      }
       synchronized (this) {
          if (!closed) {
             server.callBrokerPlugins(server.hasBrokerPlugins() ? plugin -> plugin.beforeCloseSession(this,
failed) : null);


Mime
View raw message