Merge pull request #504 from matrix-org/dbkr/fix_login_if_joined

Prevent error when clicking 'log in'
This commit is contained in:
Richard van der Hoff 2016-09-30 11:04:18 +01:00 committed by GitHub
commit 302074c71f

View file

@ -67,7 +67,9 @@ export default class MessageComposer extends React.Component {
}
componentWillUnmount() {
MatrixClientPeg.get().removeListener("event", this.onEvent);
if (MatrixClientPeg.get()) {
MatrixClientPeg.get().removeListener("event", this.onEvent);
}
}
onEvent(event) {