From fd96d5843d52db8aba42623d41c4a9861df6e78c Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Tue, 14 Mar 2023 14:13:57 +0530 Subject: [PATCH] Throw error if verification was cancelled --- src/matrix/verification/SAS/channel/Channel.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/matrix/verification/SAS/channel/Channel.ts b/src/matrix/verification/SAS/channel/Channel.ts index 68816a5f..be6e6fe4 100644 --- a/src/matrix/verification/SAS/channel/Channel.ts +++ b/src/matrix/verification/SAS/channel/Channel.ts @@ -249,6 +249,9 @@ export class ToDeviceChannel extends Disposables implements IChannel { } waitForEvent(eventType: string): Promise { + if (this._isCancelled) { + throw new VerificationCancelledError(); + } // Check if we already received the message const receivedMessage = this.receivedMessages.get(eventType); if (receivedMessage) {