From 544b36604367bc77a1c2dcd948166ce6eb4bfbeb Mon Sep 17 00:00:00 2001 From: jprocter Date: Thu, 18 Feb 2010 12:00:27 +0000 Subject: [PATCH] supress occasional null pointer exceptions (unverified fix) git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@507 be28352e-c001-0410-b1a7-c7978e42abec --- src/uk/ac/vamsas/client/simpleclient/FileLock.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/uk/ac/vamsas/client/simpleclient/FileLock.java b/src/uk/ac/vamsas/client/simpleclient/FileLock.java index b5ddbf3..9f91268 100644 --- a/src/uk/ac/vamsas/client/simpleclient/FileLock.java +++ b/src/uk/ac/vamsas/client/simpleclient/FileLock.java @@ -77,9 +77,15 @@ public class FileLock extends Lock { private void tidy() { if (_lock != null) { if (advisory != null) { + File tgt = advisory.target; // TODO: fix occasional exceptions raised here (usually on JVM shutdown) - if (advisory.target != null) { - advisory.target.deleteOnExit(); // release will null the target + if (tgt != null) { + try { + tgt.deleteOnExit(); // release will null the target + } catch (NullPointerException e) + { + // ignore - TODO: fix nulls + } } advisory.release(true); } -- 1.7.10.2