Skip to content

fix: filter invalid data to avoid subsequent nil pointers#3069

Merged
Jarvis1105 merged 1 commit intomainfrom
fix-3068
Jun 27, 2025
Merged

fix: filter invalid data to avoid subsequent nil pointers#3069
Jarvis1105 merged 1 commit intomainfrom
fix-3068

Conversation

@LordofAvernus
Copy link
Copy Markdown
Collaborator

@LordofAvernus LordofAvernus commented Jun 27, 2025

User description

关联的 issue

#3068

描述你的变更

修复规则列表查询出错

确认项(pr提交后操作)

Tip

请在指定复审人之前,确认并完成以下事项,完成后✅


  • 我已完成自测
  • 我已记录完整日志方便进行诊断
  • 我已在关联的issue里补充了实现方案
  • 我已在关联的issue里补充了测试影响面
  • 我已确认了变更的兼容性,如果不兼容则在issue里标记 not_compatible
  • 我已确认了是否要更新文档,如果要更新则在issue里标记 need_update_doc


Description

  • 清洗关联数据,避免nil指针错误

  • 新增辅助过滤函数防止子表加载为空

  • 修复规则模版列表查询异常问题


Changes walkthrough 📝

Relevant files
Bug fix
rule.go
增加数据清洗以防止nil指针异常                                                                                 

sqle/model/rule.go

  • 添加filterValidRuleList函数过滤nil Rule数据
  • 添加filterValidCustomRuleList函数过滤nil CustomRule数据
  • 在查询后执行数据清洗处理
  • 保持原有标签筛选逻辑不变
  • +26/-0   

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • @github-actions
    Copy link
    Copy Markdown

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    @Jarvis1105 Jarvis1105 merged commit 7b3d641 into main Jun 27, 2025
    4 checks passed
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    None yet

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    2 participants