diff --git a/src/stores/room-list/previews/MessageEventPreview.ts b/src/stores/room-list/previews/MessageEventPreview.ts index 6f0dc14a58..86ec4c539b 100644 --- a/src/stores/room-list/previews/MessageEventPreview.ts +++ b/src/stores/room-list/previews/MessageEventPreview.ts @@ -30,6 +30,8 @@ export class MessageEventPreview implements IPreview { eventContent = event.getContent()['m.new_content']; } + if (!eventContent || !eventContent['body']) return null; // invalid for our purposes + let body = (eventContent['body'] || '').trim(); const msgtype = eventContent['msgtype']; if (!body || !msgtype) return null; // invalid event, no preview