Browse Source

fix #2281 check if theme directory exists

Shinsuke Sugaya 5 years ago
parent
commit
75e1d6bd0f
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/main/java/org/codelibs/fess/helper/ThemeHelper.java

+ 6 - 0
src/main/java/org/codelibs/fess/helper/ThemeHelper.java

@@ -103,6 +103,12 @@ public class ThemeHelper {
     }
 
     protected void closeQuietly(final Path dir) {
+        if (Files.notExists(dir)) {
+            if (logger.isDebugEnabled()) {
+                logger.debug("{} does not exists.", dir);
+            }
+            return;
+        }
         try (Stream<Path> walk = Files.walk(dir, FileVisitOption.FOLLOW_LINKS)) {
             walk.sorted(Comparator.reverseOrder()).forEach(f -> {
                 if (logger.isDebugEnabled()) {