diff --git a/src/components/views/messages/MKeyVerificationConclusion.js b/src/components/views/messages/MKeyVerificationConclusion.js index 76370ba148..ececfc60ed 100644 --- a/src/components/views/messages/MKeyVerificationConclusion.js +++ b/src/components/views/messages/MKeyVerificationConclusion.js @@ -40,7 +40,10 @@ export default class MKeyVerificationConclusion extends React.Component { if (request) { request.off("change", this._onRequestChanged); } - MatrixClientPeg.removeListener("userTrustStatusChanged", this._onTrustChanged); + const cli = MatrixClientPeg.get(); + if (cli) { + cli.removeListener("userTrustStatusChanged", this._onTrustChanged); + } } _onRequestChanged = () => {