Fix tests

pull/21833/head
Luke Barnard 2018-03-14 14:55:36 +00:00
parent 8672b97f9a
commit c903cc6375
1 changed files with 4 additions and 1 deletions

View File

@ -53,7 +53,10 @@ module.exports = React.createClass({
},
componentWillUnmount: function() {
MatrixClientPeg.get().removeListener("RoomState.events", this.onRoomStateEvents);
const cli = MatrixClientPeg.get();
if (cli) {
cli.removeListener("RoomState.events", this.onRoomStateEvents);
}
},
componentWillReceiveProps: function(newProps) {