From 9a225840ce6a43f5e62a03a18cbe28ba6a1ecc7b Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 14 Jun 2018 12:00:53 +0100 Subject: [PATCH] check type before msgtype in the case of `m.sticker` with msgtype (undef) Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/messages/MessageEvent.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/views/messages/MessageEvent.js b/src/components/views/messages/MessageEvent.js index c4d29257ff..fd51e6074b 100644 --- a/src/components/views/messages/MessageEvent.js +++ b/src/components/views/messages/MessageEvent.js @@ -72,10 +72,10 @@ module.exports = React.createClass({ let BodyType = UnknownBody; if (!this.props.mxEvent.isRedacted()) { // only resolve BodyType if event is not redacted - if (msgtype && bodyTypes[msgtype]) { - BodyType = bodyTypes[msgtype]; - } else if (type && evTypes[type]) { + if (type && evTypes[type]) { BodyType = evTypes[type]; + } else if (msgtype && bodyTypes[msgtype]) { + BodyType = bodyTypes[msgtype]; } else if (content.url) { // Fallback to MFileBody if there's a content URL BodyType = bodyTypes['m.file'];