diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2020-12-03 01:49:18 +0100 |
---|---|---|
committer | Christian Halstrick <christian.halstrick@sap.com> | 2020-12-17 18:41:52 +0100 |
commit | 3705ac58391f979d2a7b6689dd96d6531e975c53 (patch) | |
tree | 75ff8b22cb3a28b5395d7397be7e6c735bf9733a /org.eclipse.jgit.test | |
parent | a2bb540f2998689ae9c7f894ca5d74c6c55f9127 (diff) | |
download | jgit-3705ac58391f979d2a7b6689dd96d6531e975c53.tar.gz jgit-3705ac58391f979d2a7b6689dd96d6531e975c53.zip |
[spotbugs] Fix potential NPE in GcPruneNonReferencedTest
File#listFiles can return null, assert it is not null to fix the
warning.
Change-Id: I28fc668fee760d39965e6e039003ac9f85fd461b
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/internal/storage/file/GcPruneNonReferencedTest.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPruneNonReferencedTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPruneNonReferencedTest.java index 796df3db06..7386621204 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPruneNonReferencedTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPruneNonReferencedTest.java @@ -12,6 +12,7 @@ package org.eclipse.jgit.internal.storage.file; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.io.File; @@ -89,6 +90,7 @@ public class GcPruneNonReferencedTest extends GcTestCase { private void assertNoEmptyFanoutDirectories() { File[] fanout = repo.getObjectsDirectory().listFiles(); + assertNotNull(fanout); for (File f : fanout) { if (f.isDirectory()) { String[] entries = f.list(); |