From 05bf200a722545a8433b7d2b3908e9b9ce520151 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 13 Aug 2018 13:49:22 +0100 Subject: [PATCH] Don't crash if scrollbars updated before init The initialisation here is done on a timer to allow the DOM elements to be in place before it's run, so it's possible for an update to happen ebfore the initialisation. Stop & bail out if there is no this.stickies. --- src/components/views/rooms/RoomList.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/views/rooms/RoomList.js b/src/components/views/rooms/RoomList.js index 2bd0f473bc..759951d36d 100644 --- a/src/components/views/rooms/RoomList.js +++ b/src/components/views/rooms/RoomList.js @@ -1,6 +1,6 @@ /* Copyright 2015, 2016 OpenMarket Ltd -Copyright 2017 Vector Creations Ltd +Copyright 2017, 2018 Vector Creations Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -451,6 +451,8 @@ module.exports = React.createClass({ } } + if (!this.stickies) return; + const self = this; let scrollStuckOffset = 0; // Scroll to the passed in position, i.e. a header was clicked and in a scroll to state