Fix softcrash if editing silly events
If you sent an event with a body of the empty json object, riot would then softcrash when you pressed the up arrow because it would try to treat a json object as a string and run split on it.
This commit is contained in:
parent
d14c0c342d
commit
0464b094a6
1 changed files with 1 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue