mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 17:56:01 +03:00
Add a null guard for message event previews
This commit is contained in:
parent
cc23f23f19
commit
ae076a7439
1 changed files with 2 additions and 0 deletions
|
@ -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 a new issue