Skip to content

fix(integrations): Add optional chaining to prevent TypeError - #121493

Open
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/js-3b9d-optional-chaining
Open

fix(integrations): Add optional chaining to prevent TypeError#121493
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/js-3b9d-optional-chaining

Conversation

@sentry

@sentry sentry Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

This PR addresses JAVASCRIPT-3B9D, a TypeError: undefined is not an object occurring when accessing integration?.provider.key.

The root cause was that the optional chaining only guarded against integration being nullish, but not integration.provider. If integration was defined but integration.provider was undefined (e.g., due to an incomplete API response), attempting to access .key on undefined would cause a crash.

The fix involves adding optional chaining to provider as well, changing integration?.provider.key to integration?.provider?.key in static/app/views/settings/organizationIntegrations/configureIntegration.tsx on line 97. This ensures the expression safely evaluates to undefined if integration.provider is missing, preventing the TypeError.

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 JAVASCRIPT-3B9D

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

@sentry
sentry Bot marked this pull request as ready for review August 6, 2026 22:41
@sentry
sentry Bot requested a review from a team as a code owner August 6, 2026 22:41
@sentry
sentry Bot requested a review from TkDodo August 6, 2026 22:41
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants