diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2018-09-13 00:54:58 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2018-09-13 00:54:58 +0200 |
commit | 63fe317f600dcc0e4b2788b5db18ea24e289012b (patch) | |
tree | 1f42ab3a39907dc7c9bfc155ca81ccba47d2cb0e /org.eclipse.jgit.lfs | |
parent | cdeecbd21f12c59c111ca59731795b4ccc20c8fa (diff) | |
download | jgit-63fe317f600dcc0e4b2788b5db18ea24e289012b.tar.gz jgit-63fe317f600dcc0e4b2788b5db18ea24e289012b.zip |
[spotBugs] Fix potential NPE in SmudgeFilter#downloadLfsResource
Change-Id: Ibaf8481a5b1a96ebe1debfd98e1e2201d1005fc0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.lfs')
-rw-r--r-- | org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/SmudgeFilter.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/SmudgeFilter.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/SmudgeFilter.java index fac87c177e..7bacf49269 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/SmudgeFilter.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/SmudgeFilter.java @@ -222,7 +222,10 @@ public class SmudgeFilter extends FilterCommand { Integer.valueOf(responseCode))); } Path path = lfs.getMediaFile(ptr.getOid()); - path.getParent().toFile().mkdirs(); + Path parent = path.getParent(); + if (parent != null) { + parent.toFile().mkdirs(); + } try (InputStream contentIn = contentServerConn .getInputStream()) { long bytesCopied = Files.copy(contentIn, path); |