]> source.dussan.org Git - jgit.git/commitdiff
[spotbugs] Fix potential NPE in FSTest 59/153359/1
authorMatthias Sohn <matthias.sohn@sap.com>
Tue, 26 Nov 2019 00:48:43 +0000 (01:48 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 26 Nov 2019 00:57:20 +0000 (01:57 +0100)
Change-Id: I6ca37d045642e3aada7e6b42b3cb8c3bba014455
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FSTest.java

index 89a2fc44c781a960250983830d55c8654dacf2d7..c9a339352b3d1cc00df7c7b818f19dd1e6c042d4 100644 (file)
@@ -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);
+                               }
                        }
                }
        }