diff --git a/src/components/structures/TimelinePanel.js b/src/components/structures/TimelinePanel.js index 30b02bfcca..68e3e3b3ab 100644 --- a/src/components/structures/TimelinePanel.js +++ b/src/components/structures/TimelinePanel.js @@ -1136,7 +1136,9 @@ const TimelinePanel = createReactClass({ const messagePanel = this._messagePanel.current; if (messagePanel === undefined) return null; - const wrapperRect = ReactDOM.findDOMNode(messagePanel).getBoundingClientRect(); + const messagePanelNode = ReactDOM.findDOMNode(messagePanel); + if (!messagePanelNode) return null; // sometimes this happens for fresh rooms/post-sync + const wrapperRect = messagePanelNode.getBoundingClientRect(); const myUserId = MatrixClientPeg.get().credentials.userId; const isNodeInView = (node) => {