]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-15919 fix nullable activeRule
authorPierre <pierre.guillot@sonarsource.com>
Mon, 21 Feb 2022 12:46:34 +0000 (13:46 +0100)
committersonartech <sonartech@sonarsource.com>
Mon, 21 Feb 2022 16:42:09 +0000 (16:42 +0000)
server/sonar-webserver-pushapi/src/main/java/org/sonar/server/pushapi/qualityprofile/QualityProfileChangeEventServiceImpl.java

index 6ada60df29659f94d6c1046049785c5337f67e27..809483f135546b3c5ad6149a8c92d28edf0796f5 100644 (file)
@@ -136,12 +136,13 @@ public class QualityProfileChangeEventServiceImpl implements QualityProfileChang
     Set<RuleChange> deactivatedRules = new HashSet<>();
 
     for (ActiveRuleChange arc : activeRuleChanges) {
-      if (arc.getActiveRule() == null) {
+      ActiveRuleDto activeRule = arc.getActiveRule();
+      if (activeRule == null) {
         continue;
       }
 
       RuleChange ruleChange = new RuleChange();
-      ruleChange.setKey(arc.getActiveRule().getRuleKey().rule());
+      ruleChange.setKey(activeRule.getRuleKey().rule());
       ruleChange.setSeverity(arc.getSeverity());
       ruleChange.setLanguage(language);