Skip to content

Commit

Permalink
business param empty check
Browse files Browse the repository at this point in the history
Signed-off-by: sanxun0325 <bbz17640380550@163.com>
  • Loading branch information
binbin authored and xcaspar committed Dec 3, 2021
1 parent 97de0ef commit 70c6138
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.alibaba.chaosblade.exec.common.aop.PredicateResult;
import com.alibaba.chaosblade.exec.common.constant.ModelConstant;
import com.alibaba.chaosblade.exec.common.util.BusinessParamUtil;
import com.alibaba.chaosblade.exec.common.util.StringUtils;

import java.util.List;

Expand Down Expand Up @@ -33,6 +34,9 @@ public boolean required() {
@Override
public PredicateResult predicate(MatcherModel matcherModel) {
String bParam = matcherModel.get(ModelConstant.BUSINESS_PARAMS);
if (StringUtils.isEmpty(bParam)) {
return PredicateResult.success();
}
List<BusinessParamUtil.BusinessParam> params = BusinessParamUtil.parseFromJsonStr(bParam);
if (params == null || params.isEmpty()) {
return PredicateResult.fail(getName() + " illegal json");
Expand Down

0 comments on commit 70c6138

Please sign in to comment.