Merge pull request #2513 from jryans/null-dvb

Fix unmount TypeError in `DeviceVerifyButtons`
This commit is contained in:
J. Ryan Stinnett 2019-01-25 22:57:45 -06:00 committed by GitHub
commit 4ac617c72b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,7 +42,9 @@ export default React.createClass({
componentWillUnmount: function() { componentWillUnmount: function() {
const cli = MatrixClientPeg.get(); const cli = MatrixClientPeg.get();
cli.removeListener("deviceVerificationChanged", this.onDeviceVerificationChanged); if (cli) {
cli.removeListener("deviceVerificationChanged", this.onDeviceVerificationChanged);
}
}, },
onDeviceVerificationChanged: function(userId, deviceId, deviceInfo) { onDeviceVerificationChanged: function(userId, deviceId, deviceInfo) {