From ad82d32393eb9bfff0cce0684c2ab754cf89b32d Mon Sep 17 00:00:00 2001 From: Andrey Sorokin Date: Thu, 21 Nov 2024 16:29:10 +0500 Subject: [PATCH] fix ledger crash --- .../ui/screen/ledger/steps/LedgerConnectionViewModel.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/wallet/instance/app/src/main/java/com/tonapps/tonkeeper/ui/screen/ledger/steps/LedgerConnectionViewModel.kt b/apps/wallet/instance/app/src/main/java/com/tonapps/tonkeeper/ui/screen/ledger/steps/LedgerConnectionViewModel.kt index b94300133..ea3c3db7e 100644 --- a/apps/wallet/instance/app/src/main/java/com/tonapps/tonkeeper/ui/screen/ledger/steps/LedgerConnectionViewModel.kt +++ b/apps/wallet/instance/app/src/main/java/com/tonapps/tonkeeper/ui/screen/ledger/steps/LedgerConnectionViewModel.kt @@ -184,7 +184,10 @@ class LedgerConnectionViewModel( bleManager.startScanning { val device = it.first() - bleManager.stopScanning() + try { + bleManager.stopScanning() + } catch (_: Exception) {} + connect(device.id) } }