Merge pull request #4885 from matrix-org/travis/room-list/preview-crash-2
Add a null guard for message event previewspull/21833/head
commit
8f3c8ba804
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue