diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2009-03-03 18:59:04 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2009-03-03 18:59:04 +0000 |
| commit | a3d628bce3c00840375323a2f6bf7405fdaa250e (patch) | |
| tree | 2a180003b69f772ba5a9c9bcec8550db7d2ab30c | |
| parent | 1092c42e7ae88681b45a51210932c98af0eaa38f (diff) | |
| download | qpid-python-a3d628bce3c00840375323a2f6bf7405fdaa250e.tar.gz | |
Prevent NullPointerException when backing store file is deleted externally
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@749697 13f79535-47bb-0310-9956-ffa450edef68
| -rw-r--r-- | java/broker/src/main/java/org/apache/qpid/server/queue/FileQueueBackingStore.java | 18 |
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; + } } } |
