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
No known key found for this signature in database
GPG key ID: 3F879DA5AD802A5E

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'];