Skip to content

Commit

Permalink
server
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkPotato777 committed Jan 21, 2025
1 parent 9836921 commit 8117c83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -190,8 +191,9 @@ private void checkRiskLevelReference(Long id, String name, Long organizationId,
Set<RiskDetectRule> referencedRiskDetectRules =
riskDetectService.listAllByOrganizationId(organizationId)
.stream()
.filter(rule -> rule.getRootNode().find(ConditionExpression.ENVIRONMENT_ID.name(), id)
|| rule.getRootNode().find(ConditionExpression.ENVIRONMENT_NAME.name(), name))
.filter(rule -> Objects.nonNull(rule.getRootNode())
&& (rule.getRootNode().find(ConditionExpression.ENVIRONMENT_ID.name(), id)
|| rule.getRootNode().find(ConditionExpression.ENVIRONMENT_NAME.name(), name)))
.collect(Collectors.toSet());

if (!referencedRiskDetectRules.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ public class RiskDetectRule {
/**
* rule root node
*/
@NotNull
@Valid
private BaseTreeNode rootNode;

@NotNull
Expand Down

0 comments on commit 8117c83

Please sign in to comment.