aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2015-09-22 11:48:16 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2015-09-22 11:48:16 +0200
commit164d6d931c3b015877cbfa936f03ea4503349ddb (patch)
tree13474cfa489b72f36fbcc4cbe617a5ca301aa77f /plugins
parent8682a00ca2300a79a9133f344dd9ba2ce39ba0fa (diff)
downloadsonarqube-164d6d931c3b015877cbfa936f03ea4503349ddb.tar.gz
sonarqube-164d6d931c3b015877cbfa936f03ea4503349ddb.zip
Fix quality flaws
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/CustomMessageSensor.java10
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());
+ }
}
}