From f47d8b99dce0d13a07793460c8f1c273c8fb7e25 Mon Sep 17 00:00:00 2001 From: Maarten Draijer Date: Wed, 8 Jul 2026 08:01:33 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(frontend)=20prevent=20share=20moda?= =?UTF-8?q?l=20crash=20on=20team-based=20accesses?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- CHANGELOG.md | 1 + .../explorer/components/modals/share/ItemShareModal.tsx | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf354c789..58926a7dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to ### Fixed +- 🐛(frontend) prevent the share modal from crashing on team-based accesses - 🐛(frontend) keep uploaded items usable while malware analysis runs - 🐛(backend) stream export files from S3 without buffering diff --git a/src/frontend/apps/drive/src/features/explorer/components/modals/share/ItemShareModal.tsx b/src/frontend/apps/drive/src/features/explorer/components/modals/share/ItemShareModal.tsx index f0597d325..50097a66c 100644 --- a/src/frontend/apps/drive/src/features/explorer/components/modals/share/ItemShareModal.tsx +++ b/src/frontend/apps/drive/src/features/explorer/components/modals/share/ItemShareModal.tsx @@ -147,6 +147,13 @@ export const ItemShareModal = ({ const accessesByUserId = new Map(); data.forEach((access) => { + // Team-based accesses (access.team set, user null) grant a whole team, not a + // single user. This member list is keyed by user id and renders per-user + // rows, so skip them — otherwise `access.user.id` null-derefs and the whole + // modal crashes (a client-side exception). + if (access.team) { + return; + } const existing = accessesByUserId.get(access.user.id); if (!existing) {