From 9a2fe21bdb76cb820fe35118053cfa8c9e5b5e3f Mon Sep 17 00:00:00 2001 From: Andrei Ashikhmin Date: Tue, 21 May 2024 14:40:23 +0700 Subject: [PATCH] fix: nil check --- DashWallet/Sources/UI/CrowdNode/CrowdNodeModel.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DashWallet/Sources/UI/CrowdNode/CrowdNodeModel.swift b/DashWallet/Sources/UI/CrowdNode/CrowdNodeModel.swift index 0c0a50e8c..e9508bc80 100644 --- a/DashWallet/Sources/UI/CrowdNode/CrowdNodeModel.swift +++ b/DashWallet/Sources/UI/CrowdNode/CrowdNodeModel.swift @@ -288,8 +288,8 @@ extension CrowdNodeModel { let wallet = DWEnvironment.sharedInstance().currentWallet let result = await wallet.seed(withPrompt: NSLocalizedString("Sign the message", comment: "CrowdNode"), forAmount: 1) - if !result.1 { - if let key = wallet.privateKey(forAddress: crowdNode.accountAddress, fromSeed: result.0!) { + if let seed = result.0, !result.1 { + if let key = wallet.privateKey(forAddress: crowdNode.accountAddress, fromSeed: seed) { let signature = DSKeyManager.signMesasageDigest(key, digest: amount.value.magicDigest()) try await crowdNode.withdraw(amount: amount, signature: signature.base64EncodedString()) return true