]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4831 Fix issue when dealing with removed rules
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Wed, 27 Nov 2013 15:37:31 +0000 (16:37 +0100)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Wed, 27 Nov 2013 15:37:31 +0000 (16:37 +0100)
sonar-core/src/main/java/org/sonar/core/technicaldebt/TechnicalDebtFinder.java

index def60839db31ee6789ebd65ae65acfa2ca49a47d..06a252e593a49137ae355369d67ad48ce337e703 100644 (file)
@@ -92,8 +92,12 @@ public class TechnicalDebtFinder implements ServerComponent, BatchComponent {
       if (ruleId != null) {
         Characteristic characteristic = characteristicsById.get(dto.getParentId());
         Rule rule = rulesById.get(ruleId);
-        RuleKey ruleKey = RuleKey.of(rule.getRepositoryKey(), rule.getKey());
-        dto.toRequirement(ruleKey, characteristic);
+        if (rule != null) {
+          RuleKey ruleKey = RuleKey.of(rule.getRepositoryKey(), rule.getKey());
+          dto.toRequirement(ruleKey, characteristic);
+        } else {
+          dto.toRequirement(null, characteristic);
+        }
       }
     }
   }