Merge pull request #3596 from matrix-org/dbkr/fix_editing_softcrash

Fix softcrash if editing silly events
This commit is contained in:
David Baker
2019-11-06 11:53:18 +00:00
committed by GitHub

View File

@@ -52,6 +52,7 @@ export function canEditContent(mxEvent) {
const content = mxEvent.getOriginalContent();
const {msgtype} = content;
return (msgtype === "m.text" || msgtype === "m.emote") &&
content.body && typeof content.body === 'string' &&
mxEvent.getSender() === MatrixClientPeg.get().getUserId();
}