From 0deed4bb88f3ae52d94ca4c7c48d256aea7c51d4 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 6 Dec 2017 19:05:25 +0000 Subject: [PATCH] null guard --- src/components/views/dialogs/UnknownDeviceDialog.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/views/dialogs/UnknownDeviceDialog.js b/src/components/views/dialogs/UnknownDeviceDialog.js index 8530ebac2e..ea99fff214 100644 --- a/src/components/views/dialogs/UnknownDeviceDialog.js +++ b/src/components/views/dialogs/UnknownDeviceDialog.js @@ -123,7 +123,9 @@ export default React.createClass({ }, componentWillUnmount: function() { - MatrixClientPeg.get().removeListener("deviceVerificationChanged", this._onDeviceVerificationChanged); + if (MatrixClientPeg.get()) { + MatrixClientPeg.get().removeListener("deviceVerificationChanged", this._onDeviceVerificationChanged); + } }, _onDeviceVerificationChanged: function(userId, deviceId, deviceInfo) {