diff --git a/app/containers/message/Markdown.js b/app/containers/message/Markdown.js index 2fb12c765..db7b1910a 100644 --- a/app/containers/message/Markdown.js +++ b/app/containers/message/Markdown.js @@ -28,7 +28,9 @@ export default class Markdown extends React.Component { return null; } let m = formatText(msg); - m = emojify(m, { output: 'unicode' }); + if (m) { + m = emojify(m, { output: 'unicode' }); + } m = m.replace(/^\[([^\]]*)\]\(([^)]*)\)/, '').trim(); return ( { - if (!(attachment.author_icon || attachment.author_name || attachment.ts)) { + if (!attachment.author_name) { return null; } return ( diff --git a/app/views/RoomView/List.js b/app/views/RoomView/List.js index e5c16646e..37b062f96 100644 --- a/app/views/RoomView/List.js +++ b/app/views/RoomView/List.js @@ -123,7 +123,9 @@ export class List extends React.PureComponent { const thread = threads.find(t => t._id === item.tmid); if (thread) { let tmsg = thread.msg || (thread.attachments && thread.attachments.length && thread.attachments[0].title); - tmsg = emojify(tmsg, { output: 'unicode' }); + if (tmsg) { + tmsg = emojify(tmsg, { output: 'unicode' }); + } item = { ...item, tmsg }; } }