aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan2/AnalysisPublisher.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan2/AnalysisPublisher.java b/sonar-batch/src/main/java/org/sonar/batch/scan2/AnalysisPublisher.java
index 757f320f559..b10ac5524dd 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan2/AnalysisPublisher.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan2/AnalysisPublisher.java
@@ -132,8 +132,9 @@ public final class AnalysisPublisher {
for (Measure<?> measure : measureCache.byModule(def.getKey())) {
jsonWriter.beginObject()
.prop("metricKey", measure.metric().key());
- if (measure.inputFile() != null) {
- jsonWriter.prop("filePath", measure.inputFile().relativePath());
+ InputFile inputFile = measure.inputFile();
+ if (inputFile != null) {
+ jsonWriter.prop("filePath", inputFile.relativePath());
}
jsonWriter.prop("value", String.valueOf(measure.value()))
.endObject();