From 0cb29e86a224a3384f8ae0684fe41bfe26531b63 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 3 Jun 2019 18:38:26 +0200 Subject: [PATCH] don't assume redaction has redacted_because (local echo doesn't) --- src/components/views/messages/UnknownBody.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/views/messages/UnknownBody.js b/src/components/views/messages/UnknownBody.js index 9a172baf7c1..47432779437 100644 --- a/src/components/views/messages/UnknownBody.js +++ b/src/components/views/messages/UnknownBody.js @@ -25,7 +25,9 @@ module.exports = React.createClass({ render: function() { let tooltip = _t("Removed or unknown message type"); if (this.props.mxEvent.isRedacted()) { - const redactedBecauseUserId = this.props.mxEvent.getUnsigned().redacted_because.sender; + const unsigned = this.props.mxEvent.getUnsigned(); + const redactedBecause = unsigned && unsigned.redacted_because; + const redactedBecauseUserId = redactedBecause && redactedBecause.sender; tooltip = redactedBecauseUserId ? _t("Message removed by %(userId)s", { userId: redactedBecauseUserId }) : _t("Message removed");