Skip to content

fix(github): Prevent AttributeError from null webhook fields - #121037

Draft
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/github-webhook-null-fields
Draft

fix(github): Prevent AttributeError from null webhook fields#121037
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/github-webhook-null-fields

Conversation

@sentry

@sentry sentry Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor
GitHub webhooks can send payloads where the `installation` or `repository` fields are explicitly `null` instead of being absent. Previously, code using `event.get("key", {}).get("id")` would fail with an `AttributeError` because `event.get("key")` would return `None` (since the key exists) and then `.get("id")` would be called on `None`.

This change modifies the affected code in get_github_external_id and get_scm_stream_extra to use (event.get("key") or {}).get("id"). This ensures that if event.get("key") returns None, it correctly falls back to an empty dictionary, preventing the AttributeError.

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.

Fixes SENTRY-5RGG

Comment @sentry <feedback> on this PR to have Autofix iterate on the changes.

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Aug 2, 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.

0 participants