From: Julien Lancelot Date: Wed, 2 Jul 2014 08:17:16 +0000 (+0200) Subject: Fix quality flaws X-Git-Tag: 4.4-RC1~19 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=56e9763c66889d2072ad4f106d4150982b4e7668;p=sonarqube.git Fix quality flaws --- 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 { 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 {