Skip to content

Commit

Permalink
ImportWalletViewController: Fix addressRow crash (trustwallet#922)
Browse files Browse the repository at this point in the history
Fix unvalidated addressRow crash that happens when a user enters an invalid address during import, but still decides to submit the form.
  • Loading branch information
Ma510 authored and vikmeup committed Sep 13, 2018
1 parent 5640bea commit 85885d0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Trust/Wallet/ViewControllers/ImportWalletViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ final class ImportWalletViewController: FormViewController {
func importWallet() {
let validatedError = keystoreRow?.section?.form?.validate()
guard let errors = validatedError, errors.isEmpty else { return }
let validatedAdressError = addressRow?.section?.form?.validate()
guard let addressErrors = validatedAdressError, addressErrors.isEmpty else { return }

let keystoreInput = keystoreRow?.value?.trimmed ?? ""
let privateKeyInput = privateKeyRow?.value?.trimmed ?? ""
Expand Down

0 comments on commit 85885d0

Please sign in to comment.