Fix bug with NetworkList dropdown

The NetworkDropdown component was incorrectly guarding against a null
check when retrieving the list of networks

Signed-off-by: YaoiFangirl420 <48789208+YaoiFangirl420@users.noreply.github.com>
pull/21833/head
YaoiFangirl420 2019-03-23 20:53:09 -07:00
parent 68997f9652
commit 00335e2462
1 changed files with 3 additions and 2 deletions

View File

@ -131,10 +131,11 @@ export default class NetworkDropdown extends React.Component {
_getMenuOptions() {
const options = [];
const roomDirectory = this.props.config.roomDirectory || {};
let servers = [];
if (this.props.config.roomDirectory.servers) {
servers = servers.concat(this.props.config.roomDirectory.servers);
if (roomDirectory.servers) {
servers = servers.concat(roomDirectory.servers);
}
if (!servers.includes(MatrixClientPeg.getHomeServerName())) {