diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java index e555ee2326..0d58eed160 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java @@ -2603,7 +2603,9 @@ public class QueueImpl implements Queue { message = null; } - boolean durableRef = message != null && message.isDurable() && queue.durable; + if (message == null) return; + + boolean durableRef = message.isDurable() && queue.durable; try { message.decrementRefCount();