Fix listener removal in verification tile

Fixes https://github.com/matrix-org/riot-web-rageshakes/issues/2202
pull/21833/head
J. Ryan Stinnett 2020-02-04 23:13:55 +00:00
parent f89ae19d76
commit 110c5f0e61
1 changed files with 4 additions and 1 deletions

View File

@ -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 = () => {