diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2016-12-29 01:09:03 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2016-12-29 01:09:03 +0100 |
commit | f211bfc8411cd57e6591cbacab21e004a14553dd (patch) | |
tree | 1af946dcab71645735fce7c2bd3ff6863da9196b /org.eclipse.jgit.lfs/src/org | |
parent | fc6f02cdbafd7616f323bfe7c2c700dcba759414 (diff) | |
download | jgit-f211bfc8411cd57e6591cbacab21e004a14553dd.tar.gz jgit-f211bfc8411cd57e6591cbacab21e004a14553dd.zip |
[findBugs] Fix potential NPE in CleanFilter
Change-Id: Ibc20e9fc16be62f61748b3f59f6d70c1ebf63671
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.lfs/src/org')
-rw-r--r-- | org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/CleanFilter.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/CleanFilter.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/CleanFilter.java index 66feca7518..c4e34eed0a 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/CleanFilter.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/CleanFilter.java @@ -151,7 +151,10 @@ public class CleanFilter extends FilterCommand { FileUtils.delete(tmpFile.toFile()); } } else { - FileUtils.mkdirs(mediaFile.getParent().toFile(), true); + Path parent = mediaFile.getParent(); + if (parent != null) { + FileUtils.mkdirs(parent.toFile(), true); + } FileUtils.rename(tmpFile.toFile(), mediaFile.toFile(), StandardCopyOption.ATOMIC_MOVE); } |