[findBugs] Fix potential NPE in CleanFilter

Change-Id: Ibc20e9fc16be62f61748b3f59f6d70c1ebf63671
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
Matthias Sohn 2016-12-29 01:09:03 +01:00
parent fc6f02cdba
commit f211bfc841
1 changed files with 4 additions and 1 deletions

View File

@ -151,7 +151,10 @@ public int run() throws IOException {
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);
}