qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject qpid-jms git commit: QPIDJMS-243 Fix potential NPE on close of resource
Date Tue, 03 Jan 2017 22:18:40 GMT
Repository: qpid-jms
Updated Branches:
  refs/heads/master 81fc0d9a0 -> 91e1b02ad


QPIDJMS-243 Fix potential NPE on close of resource

On close of a not fully initialized connection resource it could
encounter an NPE because the connection session was not created.

Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/91e1b02a
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/91e1b02a
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/91e1b02a

Branch: refs/heads/master
Commit: 91e1b02ad42fcd734c411cac311fe6da228e1a38
Parents: 81fc0d9
Author: Timothy Bish <tabish121@gmail.com>
Authored: Tue Jan 3 17:18:29 2017 -0500
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Tue Jan 3 17:18:29 2017 -0500

----------------------------------------------------------------------
 .../java/org/apache/qpid/jms/provider/amqp/AmqpConnection.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/91e1b02a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnection.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnection.java
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnection.java
index e8eebb0..48271bf 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnection.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnection.java
@@ -121,7 +121,9 @@ public class AmqpConnection extends AmqpAbstractResource<JmsConnectionInfo,
Conn
 
     @Override
     public void handleResourceClosure(AmqpProvider provider, Throwable cause) {
-        connectionSession.handleResourceClosure(getProvider(), cause);
+        if (connectionSession != null) {
+            connectionSession.handleResourceClosure(getProvider(), cause);
+        }
 
         List<AmqpSession> sessionList = new ArrayList<>(sessions.values());
         for (AmqpSession session : sessionList) {


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


Mime
View raw message