Parcourir la source

fix: 判断点位值变动时,如果新旧项中一个值为空,则直接返回false

gaoyagang il y a 1 an
Parent
commit
b2deca57a5
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 4 0
      identify/single.go

+ 4 - 0
identify/single.go

@@ -52,6 +52,10 @@ func (s *SingleItem) Check(ov, nv string) string {
 }
 
 func (s *SingleItem) check(rule Rule) bool {
+	if s.ov == "" || s.nv == "" {
+		return false
+	}
+
 	var ovIn, ovNotIn, nvIn, nvNotIn = true, true, true, true
 	if rule.OvIn != nil {
 		ovIn = s.ovIn(rule.OvIn)