From c73af52fbeb20c875398afb2333438ea7123ab99 Mon Sep 17 00:00:00 2001 From: "sentry-autofix[bot]" <157164994+sentry-autofix[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 18:45:18 +0000 Subject: [PATCH 1/2] fix: handle null projects array in `useOwnerOptions` --- static/app/utils/useOwnerOptions.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/static/app/utils/useOwnerOptions.tsx b/static/app/utils/useOwnerOptions.tsx index 58ea1f4dc54132..b1fe8064761ce9 100644 --- a/static/app/utils/useOwnerOptions.tsx +++ b/static/app/utils/useOwnerOptions.tsx @@ -61,13 +61,13 @@ export function useOwnerOptions({ const {disabledTeams, memberTeams, otherTeams} = groupBy( teams as DetailedTeam[], - team => { - if ( - memberOfProjectSlugs && - !team.projects.some(({slug}) => memberOfProjectSlugs.includes(slug)) - ) { - return 'disabledTeams'; - } + team => { + if ( + memberOfProjectSlugs && + !(team.projects?.some(({slug}) => memberOfProjectSlugs.includes(slug)) ?? false) + ) { + return 'disabledTeams'; + } return team.isMember ? 'memberTeams' : 'otherTeams'; } ); From c393823dc9c92dc97294ecbce4c500bfe83f410e Mon Sep 17 00:00:00 2001 From: "getsantry[bot]" <66042841+getsantry[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 18:46:11 +0000 Subject: [PATCH 2/2] :hammer_and_wrench: apply pre-commit fixes --- static/app/utils/useOwnerOptions.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/static/app/utils/useOwnerOptions.tsx b/static/app/utils/useOwnerOptions.tsx index b1fe8064761ce9..63e27e5fa3f828 100644 --- a/static/app/utils/useOwnerOptions.tsx +++ b/static/app/utils/useOwnerOptions.tsx @@ -61,13 +61,13 @@ export function useOwnerOptions({ const {disabledTeams, memberTeams, otherTeams} = groupBy( teams as DetailedTeam[], - team => { - if ( - memberOfProjectSlugs && - !(team.projects?.some(({slug}) => memberOfProjectSlugs.includes(slug)) ?? false) - ) { - return 'disabledTeams'; - } + team => { + if ( + memberOfProjectSlugs && + !(team.projects?.some(({slug}) => memberOfProjectSlugs.includes(slug)) ?? false) + ) { + return 'disabledTeams'; + } return team.isMember ? 'memberTeams' : 'otherTeams'; } );