diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2014-01-21 14:56:45 +0100 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2014-01-21 14:59:47 +0100 |
commit | a727dd69450e2c17b64be163b32a221195303b2d (patch) | |
tree | f5c1853d9e9e8d923de114095ae1c668dcd2c342 /sonar-batch | |
parent | fe4e038a7be2a9fc040be44f51e5230a2fc414f7 (diff) | |
download | sonarqube-a727dd69450e2c17b64be163b32a221195303b2d.tar.gz sonarqube-a727dd69450e2c17b64be163b32a221195303b2d.zip |
Fix resource indexing in views
Diffstat (limited to 'sonar-batch')
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/DefaultSensorContext.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/DefaultSensorContext.java b/sonar-batch/src/main/java/org/sonar/batch/DefaultSensorContext.java index 1bc11f602db..5fabba61dbc 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/DefaultSensorContext.java +++ b/sonar-batch/src/main/java/org/sonar/batch/DefaultSensorContext.java @@ -237,7 +237,11 @@ public class DefaultSensorContext implements SensorContext { } private Resource resourceOrProject(Resource resource) { - return resource != null ? getResource(resource) : project; + if (resource == null) { + return project; + } + Resource indexedResource = getResource(resource); + return indexedResource != null ? indexedResource : resource; } @Override |