diff --git a/scm-ui/ui-components/src/repos/changesets/ChangesetAuthor.tsx b/scm-ui/ui-components/src/repos/changesets/ChangesetAuthor.tsx index 7882f09ba8..017d468888 100644 --- a/scm-ui/ui-components/src/repos/changesets/ChangesetAuthor.tsx +++ b/scm-ui/ui-components/src/repos/changesets/ChangesetAuthor.tsx @@ -128,6 +128,8 @@ const Contributors: FC = ({ persons, label, displayTextOnly }) => } }; +const emptyListOfContributors: Person[] = []; + const ChangesetAuthor: FC = ({ changeset }) => { const binder = useBinder(); @@ -140,7 +142,10 @@ const ChangesetAuthor: FC = ({ changeset }) => { }; const filterContributorsByType = (type: string) => { - return changeset.contributors.filter(p => p.type === type).map(contributor => contributor.person); + if (changeset.contributors) { + return changeset.contributors.filter(p => p.type === type).map(contributor => contributor.person); + } + return emptyListOfContributors; }; const authorLine = []; diff --git a/scm-ui/ui-types/src/Changesets.ts b/scm-ui/ui-types/src/Changesets.ts index b76d8beca8..74adfd8a78 100644 --- a/scm-ui/ui-types/src/Changesets.ts +++ b/scm-ui/ui-types/src/Changesets.ts @@ -36,7 +36,7 @@ export type Changeset = Collection & { date: Date; author: Person; description: string; - contributors: Contributor[]; + contributors?: Contributor[]; _links: Links; _embedded: { tags?: Tag[]; diff --git a/scm-ui/ui-webapp/src/repos/components/changesets/ChangesetDetails.tsx b/scm-ui/ui-webapp/src/repos/components/changesets/ChangesetDetails.tsx index 0962c1674b..fbd192111a 100644 --- a/scm-ui/ui-webapp/src/repos/components/changesets/ChangesetDetails.tsx +++ b/scm-ui/ui-webapp/src/repos/components/changesets/ChangesetDetails.tsx @@ -66,7 +66,10 @@ const BottomMarginLevel = styled(Level)` `; const countContributors = (changeset: Changeset) => { - return changeset.contributors.length + 1; + if (changeset.contributors) { + return changeset.contributors.length + 1; + } + return 1; }; const ContributorLine = styled.div`