From ae9909f59699c2a3ce004fc31d7afa95ad7f4e4f Mon Sep 17 00:00:00 2001 From: schlagmichdoch Date: Thu, 11 May 2023 19:49:57 +0200 Subject: [PATCH] fix notification "Key null invalidated" on cancel device pairing --- index.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index a56b1b1..5242217 100644 --- a/index.js +++ b/index.js @@ -286,13 +286,15 @@ class PairDropServer { } _onPairDeviceCancel(sender) { - if (sender.roomKey) { - this._removeRoomKey(sender.roomKey); - this._send(sender, { - type: 'pair-device-canceled', - roomKey: sender.roomKey, - }); - } + const roomKey = sender.roomKey + + if (!roomKey) return; + + this._removeRoomKey(roomKey); + this._send(sender, { + type: 'pair-device-canceled', + roomKey: roomKey, + }); } _onRegenerateRoomSecret(sender, message) {