mirror of
https://github.com/element-hq/element-web
synced 2024-11-24 02:05:45 +03:00
Merge pull request #3596 from matrix-org/dbkr/fix_editing_softcrash
Fix softcrash if editing silly events
This commit is contained in:
commit
e2acc90fbf
1 changed files with 1 additions and 0 deletions
|
@ -52,6 +52,7 @@ export function canEditContent(mxEvent) {
|
||||||
const content = mxEvent.getOriginalContent();
|
const content = mxEvent.getOriginalContent();
|
||||||
const {msgtype} = content;
|
const {msgtype} = content;
|
||||||
return (msgtype === "m.text" || msgtype === "m.emote") &&
|
return (msgtype === "m.text" || msgtype === "m.emote") &&
|
||||||
|
content.body && typeof content.body === 'string' &&
|
||||||
mxEvent.getSender() === MatrixClientPeg.get().getUserId();
|
mxEvent.getSender() === MatrixClientPeg.get().getUserId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue