Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
Fix crash when WAF/WAFRegional GetRule gives error (#894)
Browse files Browse the repository at this point in the history
  • Loading branch information
apgrucza authored Aug 29, 2023
1 parent ac386b8 commit 5560ce3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion resources/waf-rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ func ListWAFRules(sess *session.Session) ([]Resource, error) {
}

for _, rule := range resp.Rules {
ruleResp, _ := svc.GetRule(&waf.GetRuleInput{
ruleResp, err := svc.GetRule(&waf.GetRuleInput{
RuleId: rule.RuleId,
})
if err != nil {
return nil, err
}
resources = append(resources, &WAFRule{
svc: svc,
ID: rule.RuleId,
Expand Down
5 changes: 4 additions & 1 deletion resources/wafregional-rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@ func ListWAFRegionalRules(sess *session.Session) ([]Resource, error) {
}

for _, rule := range resp.Rules {
ruleResp, _ := svc.GetRule(&waf.GetRuleInput{
ruleResp, err := svc.GetRule(&waf.GetRuleInput{
RuleId: rule.RuleId,
})
if err != nil {
return nil, err
}
resources = append(resources, &WAFRegionalRule{
svc: svc,
ID: rule.RuleId,
Expand Down

0 comments on commit 5560ce3

Please sign in to comment.