summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/queue/FileQueueBackingStore.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/java/broker/src/main/java/org/apache/qpid/server/queue/FileQueueBackingStore.java b/java/broker/src/main/java/org/apache/qpid/server/queue/FileQueueBackingStore.java
index 4e3b2298d1..bce06fad14 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/queue/FileQueueBackingStore.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/queue/FileQueueBackingStore.java
@@ -245,14 +245,18 @@ public class FileQueueBackingStore implements QueueBackingStore
}
finally
{
- try
+ // In a FileNotFound situation writer will be null.
+ if (writer != null)
{
- writer.flush();
- writer.close();
- }
- catch (IOException e)
- {
- error = e;
+ try
+ {
+ writer.flush();
+ writer.close();
+ }
+ catch (IOException e)
+ {
+ error = e;
+ }
}
}