Skip to content

fix(frontend): prevent crash if redirect param is undefined#7788

Open
afsuyadi wants to merge 1 commit into
Flagsmith:mainfrom
afsuyadi:fix/undefined-property
Open

fix(frontend): prevent crash if redirect param is undefined#7788
afsuyadi wants to merge 1 commit into
Flagsmith:mainfrom
afsuyadi:fix/undefined-property

Conversation

@afsuyadi

@afsuyadi afsuyadi commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • [✔] I have read the Contributing Guide.
  • [ ] I have added information to docs/ if required so people know about the feature.
  • [✔] I have filled in the "Changes" section below.
  • [✔] I have filled in the "How did you test this code" section below.

Changes

Contributes to #7524

  1. A crash on the home page happens when the URL contains "invite" but has no redirect query parameter, causing invite to be undefined
  2. I Added optional chaining (?.) before .includes() calls on the invite variable in HomePage.tsx.

How did you test this code?

  1. Navigate to home page with URL containing "invite" but no redirect
  2. I try to add console.log message in my local just to see if variable invite has any value
  3. I could see the error happens when there is no redirect param in the URL
  4. After adding the optional chaining, the error disappears

Before changes:
Screencast from 16-06-26 08:22:04.webm

After changes:
Screencast from 16-06-26 08:48:55.webm

@afsuyadi afsuyadi requested a review from a team as a code owner June 16, 2026 01:38
@afsuyadi afsuyadi requested review from kyle-ssg and removed request for a team June 16, 2026 01:38
@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

@afsuyadi is attempting to deploy a commit to the Flagsmith Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the front-end Issue related to the React Front End Dashboard label Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants