Skip to content

fix: guard against None actions in get_filtered_actions#119464

Draft
billyvg wants to merge 1 commit into
masterfrom
claude/serene-cannon-j0fcf0
Draft

fix: guard against None actions in get_filtered_actions#119464
billyvg wants to merge 1 commit into
masterfrom
claude/serene-cannon-j0fcf0

Conversation

@billyvg

@billyvg billyvg commented Jul 11, 2026

Copy link
Copy Markdown
Member

Summary

Fixes a production AttributeError (SENTRY-5RDY) in the alert-rules PUT endpoint (/api/0/organizations/{org}/alert-rules/{id}/).

When a trigger's actions list contains None entries, is_included() called .get("type") on None, raising:

AttributeError: 'NoneType' object has no attribute 'get'
  File "sentry/incidents/logic.py", line 1999, in is_included
      type_slug = action.get("type")
  Local Variables:
    action = None

The fix adds an early None guard at the top of the inner is_included() function, so None entries are simply skipped. Also adds regression tests for get_filtered_actions covering the None-entry case, empty actions, and missing triggers.

Sentry issue: https://sentry.sentry.io/issues/SENTRY-5RDY
Claude session: https://claude.ai/code/session_01RCczjnRYDg9wEnRAyF1B9k

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.


Generated by Claude Code

When a trigger's actions list contains None entries,
is_included() would raise AttributeError calling .get() on None.
Add an early None check to skip such entries safely.

Fixes SENTRY-5RDY

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RCczjnRYDg9wEnRAyF1B9k
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants