[spotBugs] Fix potential NPE in SmudgeFilter#downloadLfsResource
Change-Id: Ibaf8481a5b1a96ebe1debfd98e1e2201d1005fc0 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
parent
cdeecbd21f
commit
63fe317f60
|
@ -222,7 +222,10 @@ public static Collection<Path> downloadLfsResource(Lfs lfs, Repository db,
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue