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 8802c6bc6f..bbc90f56c9 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 @@ -4382,7 +4382,7 @@ public class QueueImpl extends CriticalComponentImpl implements Queue { LinkedListIterator messagesIterator = null; private LinkedListIterator getPagingIterator() { - if (pagingIterator == null) { + if (pagingIterator == null && pageSubscription != null) { pagingIterator = pageSubscription.iterator(true); } return pagingIterator;