From e1a2d7dc75a0b678aad2e4dee55fa46cdf03385e Mon Sep 17 00:00:00 2001 From: Gary Tully Date: Wed, 9 Sep 2009 10:11:16 +0000 Subject: [PATCH] resolve potential npe in test git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@812872 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/activemq/ProducerFlowControlSendFailTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); }