aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2014-07-02 10:17:16 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2014-07-02 10:18:41 +0200
commit56e9763c66889d2072ad4f106d4150982b4e7668 (patch)
treef0d63f535d7f9d5b19ceae997768e96dcee9951f
parent8404f77c80293972e1ecfb4a54f834532a624cc4 (diff)
downloadsonarqube-56e9763c66889d2072ad4f106d4150982b4e7668.tar.gz
sonarqube-56e9763c66889d2072ad4f106d4150982b4e7668.zip
Fix quality flaws
-rw-r--r--sonar-server/src/main/java/org/sonar/server/rule/index/RuleNormalizer.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/rule/index/RuleNormalizer.java b/sonar-server/src/main/java/org/sonar/server/rule/index/RuleNormalizer.java
index fa5e522f43c..dc35e6e3a79 100644
--- a/sonar-server/src/main/java/org/sonar/server/rule/index/RuleNormalizer.java
+++ b/sonar-server/src/main/java/org/sonar/server/rule/index/RuleNormalizer.java
@@ -236,10 +236,12 @@ public class RuleNormalizer extends BaseNormalizer<RuleDto, RuleKey> {
CharacteristicDto characteristic, subCharacteristic = null;
subCharacteristic = db.debtCharacteristicDao().selectById(subCharacteristicId, session);
Integer characteristicId = subCharacteristic.getParentId();
- characteristic = db.debtCharacteristicDao().selectById(characteristicId);
- if (characteristic != null) {
- update.put(RuleField.CHARACTERISTIC.field(), characteristic.getKey());
- update.put(RuleField.SUB_CHARACTERISTIC.field(), subCharacteristic.getKey());
+ if (characteristicId != null) {
+ characteristic = db.debtCharacteristicDao().selectById(characteristicId);
+ if (characteristic != null) {
+ update.put(RuleField.CHARACTERISTIC.field(), characteristic.getKey());
+ update.put(RuleField.SUB_CHARACTERISTIC.field(), subCharacteristic.getKey());
+ }
}
}
} else {