diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2019-11-26 01:48:43 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2019-11-26 01:57:20 +0100 |
commit | 3d4c95293cf59f086d30c5239fdb14e76dae3919 (patch) | |
tree | aa751547c74e3223c81672990260a57b17d6dffc /org.eclipse.jgit.test | |
parent | 74487ffa12b3ac38b2be11d2a2eace94101da8e4 (diff) | |
download | jgit-3d4c95293cf59f086d30c5239fdb14e76dae3919.tar.gz jgit-3d4c95293cf59f086d30c5239fdb14e76dae3919.zip |
[spotbugs] Fix potential NPE in FSTest
Change-Id: I6ca37d045642e3aada7e6b42b3cb8c3bba014455
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FSTest.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FSTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FSTest.java index 89a2fc44c7..c9a339352b 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FSTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FSTest.java @@ -254,7 +254,9 @@ public class FSTest { formatter.format(t1.toInstant()), Long.valueOf(resolutionNs)), t2.compareTo(t1) > 0); } finally { - Files.delete(f); + if (f != null) { + Files.delete(f); + } } } } |