diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalCompactor.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalCompactor.java index 95c35d0b2e..aab383c1ed 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalCompactor.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalCompactor.java @@ -486,7 +486,11 @@ public class JournalCompactor extends AbstractJournalUpdateTask implements Journ @Override void execute() throws Exception { JournalRecord updateRecord = journal.getRecords().get(id); - updateRecord.addUpdateFile(usedFile, size); + if (updateRecord == null) { + ActiveMQJournalLogger.LOGGER.noRecordDuringCompactReplay(id); + } else { + updateRecord.addUpdateFile(usedFile, size); + } } @Override