Skip to content

Commit 942798c

Browse files
committed
fix review
1 parent 6cd13f5 commit 942798c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

apps/meteor/client/components/message/content/attachments/DefaultAttachment.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,16 @@ const DefaultAttachment = (attachment: DefaultAttachmentProps): ReactElement =>
8282
return field;
8383
}
8484

85-
const { value = '', title = '', ...rest } = field;
85+
const { value, title, ...rest } = field;
8686

8787
return {
8888
...rest,
89-
title: <MarkdownText variant='inline' parseEmoji content={title.replace(/(.*)/g, (line: string) => `${line} `)} />,
90-
value: <MarkdownText variant='inline' parseEmoji content={value.replace(/(.*)/g, (line: string) => `${line} `)} />,
89+
title: title ? (
90+
<MarkdownText variant='inline' parseEmoji content={title.replace(/(.*)/g, (line: string) => `${line} `)} />
91+
) : null,
92+
value: value ? (
93+
<MarkdownText variant='inline' parseEmoji content={value.replace(/(.*)/g, (line: string) => `${line} `)} />
94+
) : null,
9195
};
9296
})}
9397
/>

0 commit comments

Comments
 (0)