Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Fix bug with NetworkList dropdown
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
YaoiFangirl420 committed Mar 24, 2019
1 parent 68997f9 commit 00335e2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/views/directory/NetworkDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -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())) {
Expand Down

0 comments on commit 00335e2

Please sign in to comment.