diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackInserterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackInserterTest.java index 17f04c854..814e148db 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackInserterTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackInserterTest.java @@ -529,9 +529,12 @@ public class PackInserterTest extends RepositoryTestCase { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { - String name = file.getFileName().toString(); - if (!attrs.isDirectory() && badName.test(name)) { - bad.add(name); + Path fileName = file.getFileName(); + if (fileName != null) { + String name = fileName.toString(); + if (!attrs.isDirectory() && badName.test(name)) { + bad.add(name); + } } return FileVisitResult.CONTINUE; }