From 2623d8e7e53ff25111cafc4f3fb27af3633dd8a7 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Sun, 8 Jul 2018 03:21:41 -0500 Subject: [PATCH] Handle null body when deciding which attachments to display #804 --- app/internal_packages/message-list/lib/message-item.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/internal_packages/message-list/lib/message-item.jsx b/app/internal_packages/message-list/lib/message-item.jsx index 39bcee2a6..e6a4d4ca0 100644 --- a/app/internal_packages/message-list/lib/message-item.jsx +++ b/app/internal_packages/message-list/lib/message-item.jsx @@ -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 (