Prevent error on normalize thread message for preview (#14170)

pull/14171/head^2
Tasso Evangelista 7 years ago committed by Diego Sampaio
parent 174527c26e
commit c46c81fe06
  1. 4
      app/ui-utils/client/lib/RoomHistoryManager.js

@ -16,11 +16,11 @@ export const normalizeThreadMessage = mem((message) => {
if (message.attachments) {
const attachment = message.attachments.find((attachment) => attachment.title || attachment.description);
if (attachment.description) {
if (attachment && attachment.description) {
return s.escapeHTML(attachment.description);
}
if (attachment.title) {
if (attachment && attachment.title) {
return s.escapeHTML(attachment.title);
}
}

Loading…
Cancel
Save