diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index fff04d476d..785d22adfa 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -485,12 +485,19 @@ module.exports = withMatrixClient(React.createClass({ // Info messages are basically information about commands processed on a room const isInfoMessage = (eventType !== 'm.room.message' && eventType !== 'm.sticker'); - const EventTileType = sdk.getComponent(getHandlerTile(this.props.mxEvent)); + const tileHandler = getHandlerTile(this.props.mxEvent); // This shouldn't happen: the caller should check we support this type // before trying to instantiate us - if (!EventTileType) { - throw new Error("Event type not supported"); + if (!tileHandler) { + const {mxEvent} = this.props; + console.warn(`Event type not supported: type:${mxEvent.getType()} isState:${mxEvent.isState()}`); + return
+
+ { _t('This event could not be displayed') } +
+
; } + const EventTileType = sdk.getComponent(tileHandler); const isSending = (['sending', 'queued', 'encrypting'].indexOf(this.props.eventSendStatus) !== -1); const isRedacted = isMessageEvent(this.props.mxEvent) && this.props.isRedacted; diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 4b4989142f..c6f557764a 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -347,6 +347,7 @@ " (unsupported)": " (unsupported)", "Join as voice or video.": "Join as voice or video.", "Ongoing conference call%(supportedText)s.": "Ongoing conference call%(supportedText)s.", + "This event could not be displayed": "This event could not be displayed", "%(senderName)s sent an image": "%(senderName)s sent an image", "%(senderName)s sent a video": "%(senderName)s sent a video", "%(senderName)s uploaded a file": "%(senderName)s uploaded a file",