Skip to content

🐛(frontend) prevent share modal crash on team-based accesses#768

Open
maartendra wants to merge 1 commit into
suitenumerique:mainfrom
maartendra:fix/share-modal-team-access
Open

🐛(frontend) prevent share modal crash on team-based accesses#768
maartendra wants to merge 1 commit into
suitenumerique:mainfrom
maartendra:fix/share-modal-team-access

Conversation

@maartendra

Copy link
Copy Markdown

ItemShareModal builds its member list keyed by access.user.id, but a team-based access grants a whole team and has a null user. The first team access hits access.user.id and throws TypeError: null is not an object, so the ErrorBoundary unmounts the entire share modal ("a client-side exception has occurred") for any item that is shared with a team.

Fix

Skip team-based accesses (identified by their non-empty team) when building the per-user member list, so the null user is never dereferenced.

Team-based accesses are not yet rendered as rows in the modal (a follow-up); this change only stops the crash so the modal opens and per-user sharing keeps working on items that also have a team access.

Test

  • Share an item with a team (an access with team set and user: null), then open the share modal: on main it crashes; with this change it opens normally.

ItemShareModal builds a member list keyed by access.user.id, but team-based
accesses grant a whole team and have a null user. The first team access hit
`access.user.id` and threw "null is not an object", unmounting the entire
modal (a client-side exception) for any item shared with a team. Skip
team-based accesses (identified by their non-empty `team`) in the per-user
member list. Team accesses are not yet rendered as rows (follow-up); this
only stops the crash.
@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

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