From 6a317569d798a5d79e0cc2ef511864a15cb73c0c Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Mon, 4 Jun 2018 09:38:21 +0100 Subject: [PATCH] Add null-guard to support browsers that don't support performance Like Tor. Fixes https://github.com/vector-im/riot-web/issues/6781 --- src/components/structures/MatrixChat.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 46c1113a1d..e1c9e33055 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -398,6 +398,9 @@ export default React.createClass({ }, startPageChangeTimer() { + // Tor doesn't support performance + if (!performance || !performance.mark) return null; + // This shouldn't happen because componentWillUpdate and componentDidUpdate // are used. if (this._pageChanging) { @@ -409,6 +412,9 @@ export default React.createClass({ }, stopPageChangeTimer() { + // Tor doesn't support performance + if (!performance || !performance.mark) return null; + if (!this._pageChanging) { console.warn('MatrixChat.stopPageChangeTimer: timer not started'); return;