Browse Source

fix(roles): check for existence of org roles from team (#46197)

`member.orgRolesFromTeam` is defined but may not have any entries inside
of it.
Cathy Teng 2 years ago
parent
commit
6287cf9c41
1 changed files with 1 additions and 1 deletions
  1. 1 1
      static/app/views/settings/organizationTeams/teamMembersRow.tsx

+ 1 - 1
static/app/views/settings/organizationTeams/teamMembersRow.tsx

@@ -80,7 +80,7 @@ const TeamRoleSelect = (props: {
   // Determine the team-role, including if the current team has an org role
   // and if adding the user to the current team changes their minimum team-role
   const possibleOrgRoles = [member.orgRole];
-  if (member.orgRolesFromTeams) {
+  if (member.orgRolesFromTeams && member.orgRolesFromTeams.length > 0) {
     possibleOrgRoles.push(member.orgRolesFromTeams[0].role.id);
   }
   if (team.orgRole) {