From 2648dbd221800d778cfc49dda3a1523329b6c30b Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Wed, 22 May 2019 10:08:16 +0100 Subject: [PATCH] Guard against null rooms in `onEventDecrypted` Timeline sets may have a null room, such as with the notification timeline set. Here we check that case when events are decrypted to avoid throw an error. Fixes https://github.com/vector-im/riot-web/issues/9798 --- src/components/structures/TimelinePanel.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/structures/TimelinePanel.js b/src/components/structures/TimelinePanel.js index 9b4d5200a5..0b7b315915 100644 --- a/src/components/structures/TimelinePanel.js +++ b/src/components/structures/TimelinePanel.js @@ -556,6 +556,9 @@ const TimelinePanel = React.createClass({ }, onEventDecrypted: function(ev) { + // Can be null for the notification timeline, etc. + if (!this.props.timelineSet.room) return; + // Need to update as we don't display event tiles for events that // haven't yet been decrypted. The event will have just been updated // in place so we just need to re-render.