summaryrefslogtreecommitdiff
path: root/qpid/java
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2009-03-03 18:59:04 +0000
committerMartin Ritchie <ritchiem@apache.org>2009-03-03 18:59:04 +0000
commit1541ef71942d0b86cb180100548825a42113c711 (patch)
tree44523a5e2313c9ccf492045d6f1b4adb20887352 /qpid/java
parente5580ccaeabbb75f4c849fba7ee62c9e11500c96 (diff)
downloadqpid-python-1541ef71942d0b86cb180100548825a42113c711.tar.gz
Prevent NullPointerException when backing store file is deleted externally
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@749697 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/queue/FileQueueBackingStore.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/FileQueueBackingStore.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/FileQueueBackingStore.java
index 4e3b2298d1..bce06fad14 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/FileQueueBackingStore.java
+++ b/qpid/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;
+ }
}
}