Skip to content

fix(frontend): add guard against null model#7778

Open
afsuyadi wants to merge 1 commit into
Flagsmith:mainfrom
afsuyadi:fix-null-properties
Open

fix(frontend): add guard against null model#7778
afsuyadi wants to merge 1 commit into
Flagsmith:mainfrom
afsuyadi:fix-null-properties

Conversation

@afsuyadi

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 #7511

  1. Error happens when CompareIdentities component is trying to access variable environments
  2. That variable is accessed by calling ProjectStore component, and then executing method getEnvironmentIdFromKey()
  3. By observing method getEnvironmentIdFromKey() inside file project-store.js, it can be deduced that the error happens when object store.model is still null
  4. To prevent this error when component CompareIdentities is still rendered, I add guard to ensure store.model is accessed only when it has value.

How did you test this code?

  1. I try to reproduce the issue in my local environment, by observing the console before and after the fix has been applied.
  2. However, it seems that the error is quite difficult to be reproduced, as this error seems to happen in Sentry environment. CMIIW.

Before fix:
Screencast from 13-06-26 07:26:56.webm

After fix:
Screencast from 13-06-26 07:30:07.webm

@afsuyadi afsuyadi requested a review from a team as a code owner June 13, 2026 00:53
@afsuyadi afsuyadi requested review from talissoncosta and removed request for a team June 13, 2026 00:53
@vercel

vercel Bot commented Jun 13, 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 13, 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