From 9e8234c98fce26c62339641add94e13ee7cb271f Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 3 Oct 2019 23:00:08 +0100 Subject: [PATCH] Handle null from TimelinePanel.getScrollState in RoomView _getScrollState Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/RoomView.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 13523104ae..27b9d93e50 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -1417,7 +1417,8 @@ module.exports = createReactClass({ const scrollState = messagePanel.getScrollState(); - if (scrollState.stuckAtBottom) { + // getScrollState on TimelinePanel *may* return null, so guard against that + if (!scrollState || scrollState.stuckAtBottom) { // we don't really expect to be in this state, but it will // occasionally happen when no scroll state has been set on the // messagePanel (ie, we didn't have an initial event (so it's