diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-09-22 11:48:16 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-09-22 11:48:16 +0200 |
commit | 164d6d931c3b015877cbfa936f03ea4503349ddb (patch) | |
tree | 13474cfa489b72f36fbcc4cbe617a5ca301aa77f /plugins/sonar-xoo-plugin | |
parent | 8682a00ca2300a79a9133f344dd9ba2ce39ba0fa (diff) | |
download | sonarqube-164d6d931c3b015877cbfa936f03ea4503349ddb.tar.gz sonarqube-164d6d931c3b015877cbfa936f03ea4503349ddb.zip |
Fix quality flaws
Diffstat (limited to 'plugins/sonar-xoo-plugin')
-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()); + } } } |