Avoid room directory error without a client

pull/21833/head
J. Ryan Stinnett 2019-02-11 12:12:47 +00:00
parent 84082ebb34
commit 97aa0b52fa
1 changed files with 5 additions and 0 deletions

View File

@ -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});