Handle null body when deciding which attachments to display #804

This commit is contained in:
Ben Gotow 2018-07-08 03:21:41 -05:00
parent 8df74d184d
commit 2623d8e7e5

View file

@ -101,9 +101,11 @@ export default class MessageItem extends React.Component {
}
_renderAttachments() {
const { files = [], body = '', id } = this.props.message;
const { files = [], body, id } = this.props.message;
const { filePreviewPaths, downloads } = this.state;
const attachedFiles = files.filter(f => !f.contentId || !body.includes(`cid:${f.contentId}`));
const attachedFiles = files.filter(
f => !f.contentId || !(body || '').includes(`cid:${f.contentId}`)
);
return (
<div>