fix #1501 fixed NPE
This commit is contained in:
parent
2815bc49be
commit
bcba98e1ee
1 changed files with 5 additions and 1 deletions
|
@ -447,7 +447,11 @@ public class ThumbnailManager {
|
|||
}
|
||||
|
||||
private boolean deleteEmptyDirectory(final Path dir) throws IOException {
|
||||
if (dir.toFile().list().length == 0 && !dir.toFile().getName().equals(THUMBNAILS_DIR_NAME)) {
|
||||
if (dir == null) {
|
||||
return false;
|
||||
}
|
||||
final File directory = dir.toFile();
|
||||
if (directory.list() != null && directory.list().length == 0 && !THUMBNAILS_DIR_NAME.equals(directory.getName())) {
|
||||
Files.delete(dir);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Delete " + dir);
|
||||
|
|
Loading…
Add table
Reference in a new issue