Skip to content

Commit

Permalink
fix assignment to entry in nil map
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Labarussias <issif+github@gadz.org>
  • Loading branch information
Issif committed Jan 12, 2024
1 parent 80727ec commit e575878
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/rules/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,11 @@ func ParseRules(files []string) *[]*Rule {
if actionRule.Continue != action.Continue {
rule.Actions[n].Continue = actionRule.Continue
}
if rule.Actions[n].Parameters == nil {
rule.Actions[n].Parameters = make(map[string]interface{})
}
for parameterKey := range actionRule.Parameters {
if actionRule.Parameters[parameterKey] != action.Parameters[parameterKey] {
rule.Actions[n].Parameters[parameterKey] = actionRule.Parameters[parameterKey]
}
rule.Actions[n].Parameters[parameterKey] = actionRule.Parameters[parameterKey]
}
}
}
Expand Down

0 comments on commit e575878

Please sign in to comment.