1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-15 11:01:52 +03:00

check type before msgtype in the case of m.sticker with msgtype (undef)

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2018-06-14 12:00:53 +01:00
parent 20caea47f8
commit 9a225840ce

View File

@ -72,10 +72,10 @@ module.exports = React.createClass({
let BodyType = UnknownBody; let BodyType = UnknownBody;
if (!this.props.mxEvent.isRedacted()) { if (!this.props.mxEvent.isRedacted()) {
// only resolve BodyType if event is not redacted // only resolve BodyType if event is not redacted
if (msgtype && bodyTypes[msgtype]) { if (type && evTypes[type]) {
BodyType = bodyTypes[msgtype];
} else if (type && evTypes[type]) {
BodyType = evTypes[type]; BodyType = evTypes[type];
} else if (msgtype && bodyTypes[msgtype]) {
BodyType = bodyTypes[msgtype];
} else if (content.url) { } else if (content.url) {
// Fallback to MFileBody if there's a content URL // Fallback to MFileBody if there's a content URL
BodyType = bodyTypes['m.file']; BodyType = bodyTypes['m.file'];