Skip to content

Commit 74872c3

Browse files
committed
fix: Broken null contributors
1 parent b80e89f commit 74872c3

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/library-authoring/data/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ export interface LibraryPublishContributor {
10081008
}
10091009

10101010
export interface LibraryHistoryEntry {
1011-
contributor: LibraryPublishContributor;
1011+
contributor?: LibraryPublishContributor | null;
10121012
changedAt: string;
10131013
title: string;
10141014
itemType: string;

src/library-authoring/generic/history-log/HistoryLogGroup.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export interface HistoryPublishLogGroupProps extends LibraryPublishHistoryGroup
4545

4646
interface ContributorAvatarProps {
4747
username?: string;
48-
src: string;
48+
src?: string;
4949
className: string;
5050
size: ComponentProps<typeof Avatar>['size'];
5151
}
@@ -134,7 +134,7 @@ const HistoryLogGroupEntries = ({
134134
<Stack direction="horizontal" gap={2} className="ml-1.5">
135135
<ContributorAvatar
136136
username={entry.contributor?.username || intl.formatMessage(messages.historyEntryDefaultUser)}
137-
src={entry.contributor.profileImageUrls.medium}
137+
src={entry.contributor?.profileImageUrls.medium}
138138
className="history-log-group-avatar small-avatar"
139139
size="sm"
140140
/>
@@ -143,7 +143,7 @@ const HistoryLogGroupEntries = ({
143143
<FormattedMessage
144144
{...entryMessage}
145145
values={{
146-
user: entry.contributor.username ?? intl.formatMessage(messages.historyEntryDefaultUser),
146+
user: entry.contributor?.username ?? intl.formatMessage(messages.historyEntryDefaultUser),
147147
displayName: <span className="history-log-title text-truncate">{entry.title}</span>,
148148
icon: <Icon src={getItemIcon(entry.itemType)} />,
149149
}}

0 commit comments

Comments
 (0)