From 97aa0b52fad7a0fdbd63bd183bf4c107545b3834 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 11 Feb 2019 12:12:47 +0000 Subject: [PATCH] Avoid room directory error without a client --- src/components/structures/RoomDirectory.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index 5309b02041..e13eab8eb3 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -78,6 +78,11 @@ module.exports = React.createClass({ this.protocols = null; this.setState({protocolsLoading: true}); + if (!MatrixClientPeg.get()) { + // We may not have a client yet when invoked from welcome page + this.setState({protocolsLoading: false}); + return; + } MatrixClientPeg.get().getThirdpartyProtocols().done((response) => { this.protocols = response; this.setState({protocolsLoading: false});