Skip to content

Commit

Permalink
Handle null body when deciding which attachments to display #804
Browse files Browse the repository at this point in the history
  • Loading branch information
bengotow committed Jul 8, 2018
1 parent 8df74d1 commit 2623d8e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/internal_packages/message-list/lib/message-item.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 2623d8e

Please sign in to comment.