diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index de3e10c00c..6acd43a25d 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -728,6 +728,7 @@ module.exports = React.createClass({ var result = this.state.searchResults.results[i]; var mxEv = result.context.getEvent(); + var roomId = mxEv.getRoomId(); if (!EventTile.haveTileForEvent(mxEv)) { // XXX: can this ever happen? It will make the result count @@ -736,7 +737,6 @@ module.exports = React.createClass({ } if (this.state.searchScope === 'All') { - var roomId = mxEv.getRoomId(); if(roomId != lastRoomId) { var room = cli.getRoom(roomId); @@ -753,7 +753,7 @@ module.exports = React.createClass({ } } - var resultLink = "#/room/"+this.props.roomId+"/"+mxEv.getId(); + var resultLink = "#/room/"+roomId+"/"+mxEv.getId(); ret.push(