aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2015-07-23 16:01:22 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2015-07-23 16:01:51 +0200
commitd100fd84456dd2470a01e590d28d75a0eec12bc1 (patch)
treecaa425d2dedc878e02bfa9536c0894970cac483c /plugins
parent4dac26ada623bf078eae21fdfafc764f8d38c4cc (diff)
downloadsonarqube-d100fd84456dd2470a01e590d28d75a0eec12bc1.tar.gz
sonarqube-d100fd84456dd2470a01e590d28d75a0eec12bc1.zip
Fix NPE when using old Issuable API
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/DeprecatedResourceApiSensor.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/DeprecatedResourceApiSensor.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/DeprecatedResourceApiSensor.java
index 99a6e39fe1a..03a952fa285 100644
--- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/DeprecatedResourceApiSensor.java
+++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/DeprecatedResourceApiSensor.java
@@ -65,6 +65,13 @@ public class DeprecatedResourceApiSensor implements Sensor {
.line(1)
.build());
+ // Message and line are nullable
+ issuable.addIssue(issuable.newIssueBuilder()
+ .ruleKey(RuleKey.of(XooRulesDefinition.XOO_REPOSITORY, RULE_KEY))
+ .message(null)
+ .line(null)
+ .build());
+
sonarFile = context.getResource(sonarFile);
Directory parent = sonarFile.getParent();
createIssueOnDir(parent);