From 164d6d931c3b015877cbfa936f03ea4503349ddb Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 22 Sep 2015 11:48:16 +0200 Subject: Fix quality flaws --- .../src/main/java/org/sonar/xoo/rule/CustomMessageSensor.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'plugins/sonar-xoo-plugin') 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()); + } } } -- cgit v1.2.3