Skip to content

Commit

Permalink
hotfix: don't crash if there are no participants
Browse files Browse the repository at this point in the history
  • Loading branch information
BlankParticle committed Sep 2, 2024
1 parent 5a6ccae commit cdf0d5e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ export const ConvoItem = memo(function ConvoItem({
const author = allParticipants.find(
(participant) =>
participant.participantPublicId === authorAsParticipant?.publicId
)!;
);
if (!author) return participantsWithoutAuthor;
return [author].concat(participantsWithoutAuthor);
}, [convo.participants, authorAsParticipant]);

Expand Down
1 change: 1 addition & 0 deletions apps/web/src/app/[orgShortcode]/convo/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type InfiniteConvoListUpdater = InfiniteData<
export function formatParticipantData(
participant: Convo['participants'][number]
) {
if (!participant) return null;
const typePublicId =
participant.orgMember?.publicId ??
participant.team?.publicId ??
Expand Down

0 comments on commit cdf0d5e

Please sign in to comment.