You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-10 09:22:25 +03:00
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:
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user