diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2016-05-19 15:31:51 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2016-05-30 16:07:17 -0400 |
commit | bfebe6ae4bf50250eca20b7c6bea0d06e771a817 (patch) | |
tree | 6385093c1e2506ad24a51469583a7846c54d7acf /org.eclipse.jgit.lfs.server/src | |
parent | 5b104a72759c25623c9d4e6206cddd4eafe603d3 (diff) | |
download | jgit-bfebe6ae4bf50250eca20b7c6bea0d06e771a817.tar.gz jgit-bfebe6ae4bf50250eca20b7c6bea0d06e771a817.zip |
[findBugs] Prevent potential NPE in FileLfsRepository.getOutputStream()
Change-Id: I6f91997e8a976e5f4ace91c082d8b9adf1451adc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.lfs.server/src')
-rw-r--r-- | org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsRepository.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsRepository.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsRepository.java index 2e71c0407e..dd70a364e4 100644 --- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsRepository.java +++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsRepository.java @@ -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); } |