diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/CustomMessageSensor.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/CustomMessageSensor.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/CustomMessageSensor.java index 2738c485bba..df72749dfc8 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/CustomMessageSensor.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/CustomMessageSensor.java @@ -51,9 +51,11 @@ public class CustomMessageSensor 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(settings.getString(MESSAGE_PROPERTY)) - .build()); + if (issuable != null) { + issuable.addIssue(issuable.newIssueBuilder() + .ruleKey(ruleKey) + .message(settings.getString(MESSAGE_PROPERTY)) + .build()); + } } } |