From dfd0704e62b8d3fc3f4075d0dbdcdec07a7345c3 Mon Sep 17 00:00:00 2001 From: David Totraev Date: Thu, 21 Nov 2024 17:21:43 +0500 Subject: [PATCH] fix: review --- src/core/WalletConnector.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/WalletConnector.ts b/src/core/WalletConnector.ts index 11750db..dcbb929 100644 --- a/src/core/WalletConnector.ts +++ b/src/core/WalletConnector.ts @@ -32,7 +32,11 @@ export class WalletConnector implements I async connect(walletId: string) { const wallet = this.wallets.find((wallet) => wallet.id === walletId); - this._connectedWallet = (await wallet?.connect()) ?? null; + if (!wallet) { + throw new Error("Wallet not found"); + } + + this._connectedWallet = await wallet.connect(); return this.connectedWallet; }