You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ma...@apache.org on 2016/04/25 15:34:11 UTC

[2/2] activemq-artemis git commit: [ARTEMIS-502] AMQ224044, error acknowledging message: java.lang.NullPointerException, can happen sometimes during load

[ARTEMIS-502] AMQ224044, error acknowledging message: java.lang.NullPointerException, can happen sometimes during load


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/82019cb3
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/82019cb3
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/82019cb3

Branch: refs/heads/master
Commit: 82019cb3be9092a61a2bfbab041429f9df358e4e
Parents: d947741
Author: Ingo Weiss <in...@redhat.com>
Authored: Mon Apr 25 09:56:51 2016 +0100
Committer: Martyn Taylor <mt...@redhat.com>
Committed: Mon Apr 25 14:33:17 2016 +0100

----------------------------------------------------------------------
 .../activemq/artemis/core/server/impl/ServerConsumerImpl.java   | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/82019cb3/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java
----------------------------------------------------------------------
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 7071da6..fac4cf3 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();
          }