fix flashing `by ""`

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
Michael Telatynski 2020-04-27 23:16:08 +01:00
parent 9dd204dd10
commit a399b1018a
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ const RedactedBody = React.forwardRef<any, IProps>(({mxEvent}, ref) => {
let text = _t("Message deleted");
const redactedBecauseUserId = mxEvent.getUnsigned().redacted_because.sender;
if (redactedBecauseUserId !== cli.getUserId()) {
if (redactedBecauseUserId && redactedBecauseUserId !== cli.getUserId()) {
const room = cli.getRoom(mxEvent.getRoomId());
const sender = room && room.getMember(redactedBecauseUserId);
text = _t("Message deleted by %(name)s", { name: sender ? sender.name : redactedBecauseUserId });