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.
pull/21833/head
David Baker 2018-08-13 13:49:22 +01:00
parent 16b7763c0e
commit 05bf200a72
1 changed files with 3 additions and 1 deletions

View File

@ -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