Skip to content

Commit

Permalink
🐛 Fix NPE when a plugins directory is scanned but it does not contain…
Browse files Browse the repository at this point in the history
… any jars

#495
  • Loading branch information
ujibang committed Dec 15, 2023
1 parent 6d1de84 commit 4bc4fd2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/main/java/org/restheart/plugins/PluginsScanner.java
Expand Up @@ -440,7 +440,9 @@ private URL[] _findPluginsJars(Path dir, int depth) {
for (Path subdir : ds) {
if (Files.isReadable(subdir)) {
var subjars = _findPluginsJars(subdir, depth + 1);
Arrays.stream(subjars).forEach(jar -> urls.add(jar));
if (subjars != null) {
Arrays.stream(subjars).forEach(jar -> urls.add(jar));
}
} else {
LOGGER.warn("Subdirectory {} of plugins directory {} is not readable", subdir, Bootstrapper.getConfiguration().coreModule().pluginsDirectory());
}
Expand Down

0 comments on commit 4bc4fd2

Please sign in to comment.