activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject activemq git commit: https://issues.apache.org/jira/browse/AMQ-5431 - prevent NPE when a Detach frame is received for a link that didn't get as far as setting a context during creation before being detached/closed
Date Tue, 25 Nov 2014 09:44:35 GMT
Repository: activemq
Updated Branches:
  refs/heads/trunk 08b1bedc6 -> 5cd56e7fb


https://issues.apache.org/jira/browse/AMQ-5431 - prevent NPE when a Detach frame is received
for a
 link that didn't get as far as setting a context during creation before being
 detached/closed


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

Branch: refs/heads/trunk
Commit: 5cd56e7fb10b5651704009c74b0d180b047add29
Parents: 08b1bed
Author: Dejan Bosanac <dejan@nighttale.net>
Authored: Tue Nov 25 10:42:55 2014 +0100
Committer: Dejan Bosanac <dejan@nighttale.net>
Committed: Tue Nov 25 10:43:27 2014 +0100

----------------------------------------------------------------------
 .../apache/activemq/transport/amqp/AmqpProtocolConverter.java   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/5cd56e7f/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
index 80f7a40..35cc491 100644
--- a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
+++ b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
@@ -351,7 +351,10 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter {
         if (remoteState == EndpointState.ACTIVE) {
             onLinkOpen(link);
         } else if (remoteState == EndpointState.CLOSED) {
-            ((AmqpDeliveryListener) link.getContext()).onClose();
+            AmqpDeliveryListener context = (AmqpDeliveryListener) link.getContext();
+            if (context != null) {
+                context.onClose();
+            }
             link.close();
             link.free();
         }


Mime
View raw message