Skip to content

Commit

Permalink
Merge pull request #1635 from p2p-org/bugfix/pwn-729
Browse files Browse the repository at this point in the history
Fix empty name in case of lookup request data race
  • Loading branch information
bigearsenal authored Jan 15, 2024
2 parents a505a92 + 73cd95f commit c6b8369
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions p2p_wallet/Scenes/TabBar/TabBarViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ final class TabBarViewModel {
// Name service
Task {
guard let account = accountStorage.account else { return }
let name: String = try await nameService.getName(account.publicKey.base58EncodedString, withTLD: true) ?? ""
nameStorage.save(name: name)
if let name = try await nameService.getName(account.publicKey.base58EncodedString, withTLD: true) {
nameStorage.save(name: name)
}
}

// Notification
Expand Down

0 comments on commit c6b8369

Please sign in to comment.