From: jprocter Date: Thu, 18 Feb 2010 12:00:27 +0000 (+0000) Subject: supress occasional null pointer exceptions (unverified fix) X-Git-Tag: Release_0.2~14 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=544b36604367bc77a1c2dcd948166ce6eb4bfbeb;p=vamsas.git 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 --- 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); }