chain evaluation returns true in case of nothing to eval, also fixed stat layer comparison

This commit is contained in:
Héctor Giménez
2023-03-13 21:49:46 +09:00
parent a1a86b9e05
commit bc4402a6a1
3 changed files with 7 additions and 3 deletions

View File

@@ -27,7 +27,7 @@ func ParseLine(line string) (Rule, error) {
}
var stats []Group
if len(lineSplit) > 1 {
if len(lineSplit) > 1 && strings.TrimSpace(lineSplit[1]) != "" {
stats, err = buildGroups(lineSplit[1])
if err != nil {
return Rule{}, err
@@ -35,7 +35,7 @@ func ParseLine(line string) (Rule, error) {
}
var maxQuantity []Group
if len(lineSplit) > 2 {
if len(lineSplit) > 2 && strings.TrimSpace(lineSplit[2]) != "" {
maxQuantity, err = buildGroups(lineSplit[2])
if err != nil {
return Rule{}, err