ensure writer isn't null in removeDataFile()

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@504007 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2007-02-06 06:27:11 +00:00
parent aa18c5d6fc
commit fb3f71d895
1 changed files with 3 additions and 1 deletions

View File

@ -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"));
}