diff options
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/FileIndexer.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/FileIndexer.java b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/FileIndexer.java index 4217c08bc4f..47acad7208c 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/FileIndexer.java +++ b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/FileIndexer.java @@ -129,10 +129,12 @@ public class FileIndexer implements BatchComponent { private void indexFile(InputFileBuilder inputFileBuilder, DefaultModuleFileSystem fileSystem, Progress progress, File sourceFile, InputFile.Type type) { DeprecatedDefaultInputFile inputFile = inputFileBuilder.create(sourceFile); - // Set basedir on input file prior to adding it to the FS since exclusions filters may require the absolute path - inputFile.setModuleBaseDir(fileSystem.baseDirPath()); - if (inputFile != null && exclusionFilters.accept(inputFile, type)) { - indexFile(inputFileBuilder, fileSystem, progress, inputFile, type); + if (inputFile != null) { + // Set basedir on input file prior to adding it to the FS since exclusions filters may require the absolute path + inputFile.setModuleBaseDir(fileSystem.baseDirPath()); + if (exclusionFilters.accept(inputFile, type)) { + indexFile(inputFileBuilder, fileSystem, progress, inputFile, type); + } } } |