This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/main by this push:
     new fbfe81eb4d ARTEMIS-4581 fix NPE crash in PostOfficeImpl
fbfe81eb4d is described below

commit fbfe81eb4d5f3c3c625a9beaa9647b837ed6058a
Author: Pavel Perikov <[email protected]>
AuthorDate: Tue Nov 28 00:19:40 2023 +0400

    ARTEMIS-4581 fix NPE crash in PostOfficeImpl
---
 .../apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java
 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java
index 92eb2fadbc..f241a964af 100644
--- 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java
+++ 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java
@@ -1969,7 +1969,9 @@ public class PostOfficeImpl implements PostOffice, 
NotificationListener, Binding
          AddressSettings settings = 
addressSettingsRepository.getMatch(queue.getAddress().toString());
          if (!queue.isInternalQueue() && queue.isAutoDelete() && 
QueueManagerImpl.consumerCountCheck(queue) && (initialCheck || 
QueueManagerImpl.delayCheck(queue, settings)) && 
QueueManagerImpl.messageCountCheck(queue) && (initialCheck || 
queueWasUsed(queue, settings))) {
             // we only reap queues on the initialCheck if they are actually 
empty
-            boolean validInitialCheck = initialCheck && 
queue.getMessageCount() == 0 && !queue.getPagingStore().isPaging();
+            PagingStore queuePagingStore = queue.getPagingStore();
+            boolean isPaging = queuePagingStore != null && 
queuePagingStore.isPaging();
+            boolean validInitialCheck = initialCheck && 
queue.getMessageCount() == 0 && !isPaging;
             if (validInitialCheck || queue.isSwept()) {
                if (logger.isDebugEnabled()) {
                   if (initialCheck) {

Reply via email to