GP-3347: Throwing RuntimeException if we can't list module directories

This commit is contained in:
Ryan Kurtz 2023-04-25 08:16:36 -04:00
parent 8aa9c8be3a
commit bd2a7e00a7

View File

@ -92,7 +92,13 @@ public class ModuleUtilities {
if (!rootDir.exists() || remainingDepth <= 0) { if (!rootDir.exists() || remainingDepth <= 0) {
return moduleRootDirs; return moduleRootDirs;
} }
for (ResourceFile subDir : rootDir.listFiles(ResourceFile::isDirectory)) {
ResourceFile[] subDirs = rootDir.listFiles(ResourceFile::isDirectory);
if (subDirs == null) {
throw new RuntimeException("Failed to read directory: " + rootDir);
}
for (ResourceFile subDir : subDirs) {
if ("build".equals(subDir.getName())) { if ("build".equals(subDir.getName())) {
continue; // ignore all "build" directories continue; // ignore all "build" directories
} }