From 82019cb3be9092a61a2bfbab041429f9df358e4e Mon Sep 17 00:00:00 2001 From: Ingo Weiss Date: Mon, 25 Apr 2016 09:56:51 +0100 Subject: [PATCH] [ARTEMIS-502] AMQ224044, error acknowledging message: java.lang.NullPointerException, can happen sometimes during load --- .../artemis/core/server/impl/ServerConsumerImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java index 7071da6ed5..fac4cf3a27 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java @@ -930,6 +930,11 @@ public class ServerConsumerImpl implements ServerConsumer, ReadyListener { synchronized (lock) { // This is an optimization, if the reference is the first one, we just poll it. + // But first we need to make sure deliveringRefs isn't empty + if (deliveringRefs.isEmpty()) { + return null; + } + if (deliveringRefs.peek().getMessage().getMessageID() == messageID) { return deliveringRefs.poll(); }