supress occasional null pointer exceptions (unverified fix)
authorjprocter <jprocter@compbio.dundee.ac.uk>
Thu, 18 Feb 2010 12:00:27 +0000 (12:00 +0000)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Thu, 18 Feb 2010 12:00:27 +0000 (12:00 +0000)
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

index b5ddbf3..9f91268 100644 (file)
@@ -77,9 +77,15 @@ public class FileLock extends Lock {
   private void tidy() {\r
     if (_lock != null) {\r
       if (advisory != null) {\r
+        File tgt = advisory.target;\r
         // TODO: fix occasional exceptions raised here (usually on JVM shutdown)\r
-        if (advisory.target != null) {\r
-          advisory.target.deleteOnExit(); // release will null the target\r
+        if (tgt != null) {\r
+          try {\r
+            tgt.deleteOnExit(); // release will null the target\r
+          } catch (NullPointerException e)\r
+          {\r
+            // ignore - TODO: fix nulls \r
+          }\r
         }\r
         advisory.release(true);\r
       }\r