mirror of https://github.com/vector-im/riot-web
Merge pull request #3518 from matrix-org/t3chguy/attempt_NPE_fix
Handle null from TimelinePanel.getScrollState in RoomView _getScrollStatepull/21833/head
commit
47c41759f7
|
@ -1417,7 +1417,8 @@ module.exports = createReactClass({
|
||||||
|
|
||||||
const scrollState = messagePanel.getScrollState();
|
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
|
// we don't really expect to be in this state, but it will
|
||||||
// occasionally happen when no scroll state has been set on the
|
// occasionally happen when no scroll state has been set on the
|
||||||
// messagePanel (ie, we didn't have an initial event (so it's
|
// messagePanel (ie, we didn't have an initial event (so it's
|
||||||
|
|
Loading…
Reference in New Issue