Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit d357884

Browse files
authored
Merge pull request #3867 from matrix-org/travis/fix-messagepanel-ref
Fix error about MessagePanel not being available for read markers
2 parents 86a0a2e + df3fe51 commit d357884

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/structures/TimelinePanel.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,9 @@ const TimelinePanel = createReactClass({
11361136
const messagePanel = this._messagePanel.current;
11371137
if (messagePanel === undefined) return null;
11381138

1139-
const wrapperRect = ReactDOM.findDOMNode(messagePanel).getBoundingClientRect();
1139+
const messagePanelNode = ReactDOM.findDOMNode(messagePanel);
1140+
if (!messagePanelNode) return null; // sometimes this happens for fresh rooms/post-sync
1141+
const wrapperRect = messagePanelNode.getBoundingClientRect();
11401142
const myUserId = MatrixClientPeg.get().credentials.userId;
11411143

11421144
const isNodeInView = (node) => {

0 commit comments

Comments
 (0)