From 1d4098f93f768878fbd891f203682cc70120165c Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 23 Mar 2022 07:08:20 +0300 Subject: [PATCH] Updated on 2026-08-14 --- .../tangem/tap/domain/tasks/product/CreateWalletsTask.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/com/tangem/tap/domain/tasks/product/CreateWalletsTask.kt b/app/src/main/java/com/tangem/tap/domain/tasks/product/CreateWalletsTask.kt index 89130c4a16..6443b95987 100644 --- a/app/src/main/java/com/tangem/tap/domain/tasks/product/CreateWalletsTask.kt +++ b/app/src/main/java/com/tangem/tap/domain/tasks/product/CreateWalletsTask.kt @@ -4,6 +4,7 @@ import com.tangem.common.CompletionResult import com.tangem.common.card.EllipticCurve import com.tangem.common.core.CardSession import com.tangem.common.core.CardSessionRunnable +import com.tangem.common.core.TangemSdkError import com.tangem.operations.CommandResponse import com.tangem.operations.wallet.CreateWalletResponse import com.tangem.operations.wallet.CreateWalletTask @@ -22,6 +23,11 @@ class CreateWalletsTask( private val createdWalletsResponses = mutableListOf() override fun run(session: CardSession, callback: (result: CompletionResult) -> Unit) { + if (curves.isEmpty()){ + callback(CompletionResult.Failure(TangemSdkError.WalletIsNotCreated())) + return + } + val curve = curves[createdWalletsResponses.size] createWallet(curve, session, callback) }