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