diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-11-03 14:49:29 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-11-03 14:49:29 +0100 |
commit | 87f680eb0ada77e40b13cbd0189d863091f3781c (patch) | |
tree | 937723d126865095821e879846a751594f143943 | |
parent | a4aa639521c90b245e557c9030d34cfefd9f2eb6 (diff) | |
download | sonarqube-87f680eb0ada77e40b13cbd0189d863091f3781c.tar.gz sonarqube-87f680eb0ada77e40b13cbd0189d863091f3781c.zip |
Fix quality flaw
-rw-r--r-- | plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneDayDebtPerFileSensor.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneDayDebtPerFileSensor.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneDayDebtPerFileSensor.java index 25685bf93f8..4bf91662449 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneDayDebtPerFileSensor.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneDayDebtPerFileSensor.java @@ -46,10 +46,12 @@ public class OneDayDebtPerFileSensor extends AbstractDeprecatedXooRuleSensor { @Override protected void processFile(InputFile inputFile, org.sonar.api.resources.File sonarFile, SensorContext context, RuleKey ruleKey, String languageKey) { Issuable issuable = perspectives.as(Issuable.class, sonarFile); - issuable.addIssue(issuable.newIssueBuilder() - .ruleKey(ruleKey) - .message("This issue is generated on each file with a debt of one day") - .build()); + if (issuable != null) { + issuable.addIssue(issuable.newIssueBuilder() + .ruleKey(ruleKey) + .message("This issue is generated on each file with a debt of one day") + .build()); + } } } |