Skip to content

Commit

Permalink
fix: nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
Syn-McJ committed May 21, 2024
1 parent 60e779b commit 9a2fe21
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DashWallet/Sources/UI/CrowdNode/CrowdNodeModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9a2fe21

Please sign in to comment.