From 6decaef050941c94547dd837a6d844e51bb80964 Mon Sep 17 00:00:00 2001 From: Skyxim Date: Fri, 27 Jan 2023 12:38:15 +0800 Subject: [PATCH] fix: sub-rule condition don't work --- rules/logic/logic.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rules/logic/logic.go b/rules/logic/logic.go index 4a0bd7e8..a53503df 100644 --- a/rules/logic/logic.go +++ b/rules/logic/logic.go @@ -247,7 +247,10 @@ func matchSubRules(metadata *C.Metadata, name string, subRules map[string][]C.Ru func (logic *Logic) Match(metadata *C.Metadata) (bool, string) { switch logic.ruleType { case C.SubRules: - return matchSubRules(metadata, logic.adapter, logic.subRules) + if m, _ := logic.rules[0].Match(metadata); m { + return matchSubRules(metadata, logic.adapter, logic.subRules) + } + return false, "" case C.NOT: if m, _ := logic.rules[0].Match(metadata); !m { return true, logic.adapter