From 631a59ffccb6548ce1a2471982495e4094a7dd4b Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Sat, 26 Oct 2019 09:00:10 +0300 Subject: [PATCH 1/1] Fixed potential null pointer error --- .../meviz/htmlindexer/indexer/FilesystemIndexRemover.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/svjatoslav/meviz/htmlindexer/indexer/FilesystemIndexRemover.java b/src/main/java/eu/svjatoslav/meviz/htmlindexer/indexer/FilesystemIndexRemover.java index 9023697..a350109 100644 --- a/src/main/java/eu/svjatoslav/meviz/htmlindexer/indexer/FilesystemIndexRemover.java +++ b/src/main/java/eu/svjatoslav/meviz/htmlindexer/indexer/FilesystemIndexRemover.java @@ -31,9 +31,11 @@ public class FilesystemIndexRemover { } // recursively remove thumbnail directories from sub directories - for (final File subFile : workingDirectory.listFiles()) - if (subFile.isDirectory()) - removeIndex(subFile); + File[] files = workingDirectory.listFiles(); + if (files != null) + for (final File subFile : files) + if (subFile.isDirectory()) + removeIndex(subFile); for (final Layout layout : Utils.getLayouts()) { final File indexFile = Utils.getLayoutIndexFile(layout, -- 2.20.1