Skip to content

fix: 新建sletterSignup crashes on undefined signupSources - #1188

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/newsletter-signup-optional-chain
Open

fix: 新建sletterSignup crashes on undefined signupSources#1188
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/newsletter-signup-optional-chain

Conversation

@sentry

@sentry sentry Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Addresses a TypeError in the 新建sletterSignup component where user?.signupSources.includes('newsletter') would crash if user was defined but user.signupSources was undefined. This happened for users whose accounts might not have the signupSources field initialized.

The fix adds optional chaining (?.) to signupSources, changing the expression to user?.signupSources?.includes('newsletter') ?? false. This ensures that if signupSources is undefined, the expression safely short-circuits without throwing an error, preventing the component from crashing.

Fixes TANSTACK-COM-4W6

This PR was automatically generated by Sentry. You can adjust this setting at any time.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 28, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
tanstack-com 937bc92 Commit Preview URL

Branch Preview URL
Aug 28 2026, 11:02 PM

注册 for free to join this conversation on GitHub. Already have an account? 登录 to comment

标签

None yet

项目

None yet

Development

Successfully merging this pull request may close these issues.

0 participants