diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2015-02-11 23:27:17 +0100 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2015-02-11 23:27:17 +0100 |
commit | d41d216c069d4144def36514be7c290f4706c116 (patch) | |
tree | 7fb8a1c25d4b9fc4b09c71b5d6947e78dd3038fc /sonar-batch | |
parent | 15efbf64da4505fdc70104ee315e617f9bbedb57 (diff) | |
download | sonarqube-d41d216c069d4144def36514be7c290f4706c116.tar.gz sonarqube-d41d216c069d4144def36514be7c290f4706c116.zip |
Fix some possible NPE
Diffstat (limited to 'sonar-batch')
-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); + } } } |