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) {