Skip to content

feat(ProjectList) My Projects - #81

Closed
sergical wants to merge 1 commit into
masterfrom
sergical/my-projects
Closed

feat(ProjectList) My Projects#81
sergical wants to merge 1 commit into
masterfrom
sergical/my-projects

Conversation

@sergical

Copy link
Copy Markdown
Member
  • Adds a link in the sidebar to my projects

Comment thread src/pages/ProjectList.js
Comment on lines +478 to +479
group={{id: project.group, ...groupsList[project.group]}}
submissionsClosed={submissionsClosed}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential bug: Spreading `groupsList[project.group]` can cause a TypeError if a project has no group, as `...undefined` is not allowed. This will crash the component.
  • Description: When rendering the project list, if a project's group property is undefined, null, or an empty string, the expression groupsList[project.group] will evaluate to undefined. The code then attempts to spread this undefined value inside an object literal ({...groupsList[project.group]}). This operation throws a TypeError: undefined is not iterable, which will cause the React component to crash and prevent the project list from rendering for the user. Evidence from NewProject.js and EditProject.js confirms that projects can exist without an assigned group.
  • Suggested fix: Provide a fallback empty object to prevent the spread operator from receiving undefined. Change ...groupsList[project.group] to ...(groupsList[project.group] || {}). This ensures that if the lookup fails, an empty object is spread, which is a safe no-op.
    severity: 0.7, confidence: 0.95

Did we get this right? 👍 / 👎 to inform future reviews.

@sergical sergical closed this Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant