From 14caed62d0c1c77e72854d25cd4be4dcc0255cdb Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 2 Jul 2019 17:29:37 +0200 Subject: [PATCH] make sure scrollpanel is mounted before checking scroll have seen errors in this direction, so hope this will fix it, as this is invoked from any EventTile's onHeightChanged callback, which is often called after some async operation (by when the timeline can be unmounted already). doesn't hurt in any case. --- src/components/structures/ScrollPanel.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/structures/ScrollPanel.js b/src/components/structures/ScrollPanel.js index 7e1f0ff469..40caa627af 100644 --- a/src/components/structures/ScrollPanel.js +++ b/src/components/structures/ScrollPanel.js @@ -214,6 +214,9 @@ module.exports = React.createClass({ // after an update to the contents of the panel, check that the scroll is // where it ought to be, and set off pagination requests if necessary. checkScroll: function() { + if (this.unmounted) { + return; + } this._restoreSavedScrollState(); this.checkFillState(); },