]> source.dussan.org Git - jgit.git/commitdiff
[findBugs] Prevent potential NPE in FileLfsRepository.getOutputStream() 71/73171/3
authorMatthias Sohn <matthias.sohn@sap.com>
Thu, 19 May 2016 13:31:51 +0000 (15:31 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Mon, 30 May 2016 20:07:17 +0000 (16:07 -0400)
Change-Id: I6f91997e8a976e5f4ace91c082d8b9adf1451adc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsRepository.java

index 2e71c0407e9715ff9b8a9cb2a494fd06bfb3a4fd..dd70a364e4b0a60ecb0f87b217200193a6e5a336 100644 (file)
@@ -147,7 +147,10 @@ public class FileLfsRepository implements LargeFileRepository {
        AtomicObjectOutputStream getOutputStream(AnyLongObjectId id)
                        throws IOException {
                Path path = getPath(id);
-               Files.createDirectories(path.getParent());
+               Path parent = path.getParent();
+               if (parent != null) {
+                       Files.createDirectories(parent);
+               }
                return new AtomicObjectOutputStream(path, id);
        }