diff --git a/src/components/views/rooms/MessageComposer.js b/src/components/views/rooms/MessageComposer.js index 4aeebe1411..e78cf0b13e 100644 --- a/src/components/views/rooms/MessageComposer.js +++ b/src/components/views/rooms/MessageComposer.js @@ -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) {