From 6e5b917cc5c83ba9771e8f884b07eb271affbeff Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Fri, 21 Oct 2016 15:22:46 +0200 Subject: [PATCH] ARTEMIS-814: Fix a bug where context could be null in case a connection was closed before the flow arrived --- .../artemis/protocol/amqp/proton/AMQPConnectionContext.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPConnectionContext.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPConnectionContext.java index 1f193eb071..65ed836a2b 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPConnectionContext.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPConnectionContext.java @@ -372,7 +372,9 @@ public class AMQPConnectionContext extends ProtonInitializable { @Override public void onFlow(Link link) throws Exception { - ((ProtonDeliveryHandler) link.getContext()).onFlow(link.getCredit(), link.getDrain()); + if (link.getContext() != null) { + ((ProtonDeliveryHandler) link.getContext()).onFlow(link.getCredit(), link.getDrain()); + } } @Override