diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2015-07-23 16:01:22 +0200 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2015-07-23 16:01:51 +0200 |
commit | d100fd84456dd2470a01e590d28d75a0eec12bc1 (patch) | |
tree | caa425d2dedc878e02bfa9536c0894970cac483c /plugins | |
parent | 4dac26ada623bf078eae21fdfafc764f8d38c4cc (diff) | |
download | sonarqube-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.java | 7 |
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); |