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

Commit

Permalink
Prevent error when clicking 'log in'
Browse files Browse the repository at this point in the history
If you joined a room before clicking 'log in', it would throw an
exception here and break.
  • Loading branch information
dbkr committed Sep 29, 2016
1 parent 66ef1e8 commit 7b28dde
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/views/rooms/MessageComposer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 7b28dde

Please sign in to comment.