diff options
author | Guangrong Fu <fu.guangrong@zte.com.cn> | 2022-10-27 10:52:55 +0800 |
---|---|---|
committer | Guangrong Fu <fu.guangrong@zte.com.cn> | 2022-10-27 10:52:55 +0800 |
commit | 2fd6a2e5d048978e347835b3262643b224e5348b (patch) | |
tree | 62c5eadeadbf8993b4e5a9681b8e8c6f32908bbe /rulemgt/src/main/java | |
parent | 2cb8d26bb7af8913434d83972eb2c67c2da6908e (diff) |
bugfix - response message error
Issue-ID: HOLMES-583
Signed-off-by: Guangrong Fu <fu.guangrong@zte.com.cn>
Change-Id: Ida28cec4c1ae5a8c0560b3d4db9ab1647216f021
Diffstat (limited to 'rulemgt/src/main/java')
-rw-r--r-- | rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapper.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapper.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapper.java index ec6e9b3..0d5d110 100644 --- a/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapper.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapper.java @@ -16,6 +16,7 @@ package org.onap.holmes.rulemgt.wrapper; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.onap.holmes.common.api.entity.CorrelationRule; import org.onap.holmes.common.exception.CorrelationException; import org.onap.holmes.rulemgt.bean.request.*; @@ -79,7 +80,9 @@ public class RuleMgtWrapper { try { result = correlationRuleService.saveRule(correlationRule); } catch (CorrelationException e) { - engineWarpper.deleteRuleFromEngine(packageName, ip); + if (StringUtils.isNotEmpty(packageName)) { + engineWarpper.deleteRuleFromEngine(packageName, ip); + } throw new CorrelationException(e.getMessage(), e); } RuleAddAndUpdateResponse ruleAddAndUpdateResponse = new RuleAddAndUpdateResponse(); |