From 5a5ebee9189e7fb9fbc333797b99cca5d4ebd44b Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 8 Nov 2019 10:39:38 -0700 Subject: [PATCH] Check for a message type before assuming it is a room message Redacted messages do not have message types, despite being room messages. Fixes https://github.com/vector-im/riot-web/issues/11352 Regressed in https://github.com/matrix-org/matrix-react-sdk/pull/3601 Click-to-ping being broken (as mentioned by https://github.com/vector-im/riot-web/issues/11353) is a side effect of the react stack falling over. Once one room crashes, click-to-ping is broken everywhere. --- src/components/views/rooms/EventTile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index 786a72f5b3..22f1f914b6 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -556,10 +556,10 @@ module.exports = createReactClass({ // Info messages are basically information about commands processed on a room const isBubbleMessage = eventType.startsWith("m.key.verification") || - (eventType === "m.room.message" && msgtype.startsWith("m.key.verification")); + (eventType === "m.room.message" && msgtype && msgtype.startsWith("m.key.verification")); let isInfoMessage = ( !isBubbleMessage && eventType !== 'm.room.message' && - eventType !== 'm.sticker' && eventType != 'm.room.create' + eventType !== 'm.sticker' && eventType !== 'm.room.create' ); let tileHandler = getHandlerTile(this.props.mxEvent);