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 edd15cec2a..704e563790 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 @@ -607,8 +607,9 @@ public class ServerConsumerImpl implements ServerConsumer, ReadyListener { boolean performACK = lastConsumedAsDelivered; try { - if (largeMessageDeliverer != null) { - largeMessageDeliverer.finish(); + LargeMessageDeliverer pendingLargeMessageDeliverer = largeMessageDeliverer; + if (pendingLargeMessageDeliverer != null) { + pendingLargeMessageDeliverer.finish(); } } catch (Throwable e) { ActiveMQServerLogger.LOGGER.errorResttingLargeMessage(e, largeMessageDeliverer);