diff --git a/activemq-core/src/test/java/org/apache/activemq/ProducerFlowControlSendFailTest.java b/activemq-core/src/test/java/org/apache/activemq/ProducerFlowControlSendFailTest.java index 292fc80782..2ad512ceec 100644 --- a/activemq-core/src/test/java/org/apache/activemq/ProducerFlowControlSendFailTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/ProducerFlowControlSendFailTest.java @@ -104,7 +104,9 @@ public class ProducerFlowControlSendFailTest extends ProducerFlowControlTest { TextMessage msg; for (int idx = 0; idx < 10; ++idx) { msg = (TextMessage) consumer.receive(1000); - msg.acknowledge(); + if (msg != null) { + msg.acknowledge(); + } } keepGoing.set(false); }