@@ -503,7 +503,11 @@ module.exports = React.createClass({
503503 // matches this network. We look for a matching protocol
504504 // and the existence of a 'domain' field and if present,
505505 // its value.
506- if ( this . protocols [ network_info . protocol ] . instances . length == 1 ) {
506+ if (
507+ this . protocols [ network_info . protocol ] &&
508+ this . protocols [ network_info . protocol ] . instances &&
509+ this . protocols [ network_info . protocol ] . instances . length == 1
510+ ) {
507511 const the_instance = this . protocols [ network_info . protocol ] . instances [ 0 ] ;
508512 // If there's only one instance in this protocol, use it
509513 // as long as it has no domain (which we assume to mean it's
@@ -591,10 +595,12 @@ module.exports = React.createClass({
591595 placeholder = this . props . config . networks [ this . state . network ] . example ;
592596 }
593597
594- const showJoinButton = (
595- this . _stringLooksLikeId ( this . state . filterString , this . state . network ) &&
596- this . _getFieldsForThirdPartyLocation ( this . state . filterString , this . state . network )
597- ) ;
598+ let showJoinButton = this . _stringLooksLikeId ( this . state . filterString , this . state . network ) ;
599+ if ( this . state . network && this . state . network != '_matrix' ) {
600+ if ( this . _getFieldsForThirdPartyLocation ( this . state . filterString , this . state . network ) === null ) {
601+ showJoinButton = false ;
602+ }
603+ }
598604
599605 const SimpleRoomHeader = sdk . getComponent ( 'rooms.SimpleRoomHeader' ) ;
600606 const NetworkDropdown = sdk . getComponent ( 'directory.NetworkDropdown' ) ;
0 commit comments