Просмотр исходного кода

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 лет назад
Родитель
Сommit
6287cf9c41
1 измененных файлов с 1 добавлено и 1 удалено
  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) {