From 110c5f0e6194d8c9b67c1e1d58e8565f6aeee746 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Tue, 4 Feb 2020 23:13:55 +0000 Subject: [PATCH] Fix listener removal in verification tile Fixes https://github.com/matrix-org/riot-web-rageshakes/issues/2202 --- src/components/views/messages/MKeyVerificationConclusion.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 = () => {