update liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/condition/SwitchCondition.java.

NPE风险

Signed-off-by: zcl <9928619+zhangcl1991@user.noreply.gitee.com>
This commit is contained in:
zcl
2023-08-03 05:10:09 +00:00
committed by Gitee
parent 09f3412289
commit cf93cd43aa

View File

@@ -57,7 +57,7 @@ public class SwitchCondition extends Condition {
String _targetId = target[0];
String _targetTag = target[1];
targetExecutor = targetList.stream().filter(executable -> {
return (StrUtil.startWith(_targetId, TAG_PREFIX) && _targetTag.equals(executable.getTag()))
return (StrUtil.startWith(_targetId, TAG_PREFIX) && ObjectUtil.equal(_targetTag,executable.getTag()))
|| ((StrUtil.isEmpty(_targetId) || _targetId.equals(executable.getId()))
&& (StrUtil.isEmpty(_targetTag) || _targetTag.equals(executable.getTag())));
}).findFirst().orElse(null);