From d1b78e5b0850f46f07a896b58800147e3e62c063 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Fri, 25 Jan 2019 17:54:11 -0600 Subject: [PATCH] Fix unmount TypeError in `DeviceVerifyButtons` --- src/components/views/elements/DeviceVerifyButtons.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/views/elements/DeviceVerifyButtons.js b/src/components/views/elements/DeviceVerifyButtons.js index b88fbdfc06..cfd79529f1 100644 --- a/src/components/views/elements/DeviceVerifyButtons.js +++ b/src/components/views/elements/DeviceVerifyButtons.js @@ -42,7 +42,9 @@ export default React.createClass({ componentWillUnmount: function() { const cli = MatrixClientPeg.get(); - cli.removeListener("deviceVerificationChanged", this.onDeviceVerificationChanged); + if (cli) { + cli.removeListener("deviceVerificationChanged", this.onDeviceVerificationChanged); + } }, onDeviceVerificationChanged: function(userId, deviceId, deviceInfo) {