diff --git a/src/background/services/accounts/AccountsService.ts b/src/background/services/accounts/AccountsService.ts index 90aadb79..b9483d5d 100644 --- a/src/background/services/accounts/AccountsService.ts +++ b/src/background/services/accounts/AccountsService.ts @@ -237,6 +237,10 @@ export class AccountsService implements OnLock, OnUnlock { this.networkService, ); + if (!addresses[NetworkVMType.EVM]) { + throw new Error('The account has no EVM address'); + } + return { addressC: addresses[NetworkVMType.EVM], addressBTC: addresses[NetworkVMType.BITCOIN], @@ -375,6 +379,10 @@ export class AccountsService implements OnLock, OnUnlock { ledgerService: this.ledgerService, }); + if (!addresses[NetworkVMType.EVM] || !addresses[NetworkVMType.BITCOIN]) { + throw new Error('The account has no EVM or BTC address'); + } + const id = crypto.randomUUID(); this.accounts = { diff --git a/src/background/services/secrets/SecretsService.ts b/src/background/services/secrets/SecretsService.ts index 391386f7..930d1426 100644 --- a/src/background/services/secrets/SecretsService.ts +++ b/src/background/services/secrets/SecretsService.ts @@ -669,7 +669,7 @@ export class SecretsService implements OnUnlock { walletId: string; ledgerService: LedgerService; networkService: NetworkService; - }): Promise> { + }): Promise> { const secrets = await this.getWalletAccountsSecretsById(walletId); if (