From fb3f71d895fc5aeccf9289f0d3aba1c0d24e5f96 Mon Sep 17 00:00:00 2001 From: Robert Davies Date: Tue, 6 Feb 2007 06:27:11 +0000 Subject: [PATCH] ensure writer isn't null in removeDataFile() git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@504007 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/activemq/kaha/impl/data/DataManagerImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/data/DataManagerImpl.java b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/data/DataManagerImpl.java index 81406c7db0..7c09c7a446 100644 --- a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/data/DataManagerImpl.java +++ b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/data/DataManagerImpl.java @@ -294,7 +294,9 @@ public final class DataManagerImpl implements DataManager { private void removeDataFile(DataFile dataFile) throws IOException{ fileMap.remove(dataFile.getNumber()); - writer.force(dataFile); + if(writer!=null){ + writer.force(dataFile); + } boolean result=dataFile.delete(); log.debug("discarding data file "+dataFile+(result?"successful ":"failed")); }