From 87f680eb0ada77e40b13cbd0189d863091f3781c Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Tue, 3 Nov 2015 14:49:29 +0100 Subject: Fix quality flaw --- .../main/java/org/sonar/xoo/rule/OneDayDebtPerFileSensor.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'plugins/sonar-xoo-plugin/src') 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()); + } } } -- cgit v1.2.3