Commit 84abaec3 authored by qiuqunfeng's avatar qiuqunfeng
Browse files

Fix nil pointer dereference in ListRules method of WAF service

- Update condition to check for nil RuleCategoryStatus before accessing Status
- Ensure safe handling of WAF service rule categories
parent e5b356d0
......@@ -877,7 +877,7 @@ func (s *wafService) ListRules(ctx context.Context, regionCode, namespace, gatew
if err != nil {
return nil, fmt.Errorf("failed to get waf service: %v", err)
}
if wafService.RuleCategoryStatus.Status == 1 {
if wafService.RuleCategoryStatus != nil && wafService.RuleCategoryStatus.Status == 1 {
for _, category := range ruleCategories {
for _, categoryID := range wafService.RuleCategoryStatus.CategoryID {
if category.CategoryID == categoryID {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment