handle addition filed is empty

This commit is contained in:
Bob Sun 2017-02-15 21:25:26 +08:00
parent 1b5e98e987
commit 4f82de061d
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4

View file

@ -48,7 +48,13 @@ class EditPasswordTableViewController: PasswordEditorTableViewController {
let cellTitle = tableData[indexPath.section][indexPath.row][.title] as! String let cellTitle = tableData[indexPath.section][indexPath.row][.title] as! String
cellContents[cellTitle] = contentCell.getContent()! cellContents[cellTitle] = contentCell.getContent()!
} }
password!.updatePassword(name: cellContents["name"]!, plainText: "\(cellContents["password"]!)\n\(cellContents["additions"]!)\n") var plainText = ""
if cellContents["additions"]! != "" {
plainText = "\(cellContents["password"]!)\n\(cellContents["additions"]!)\n"
} else {
plainText = "\(cellContents["password"]!)\n"
}
password!.updatePassword(name: cellContents["name"]!, plainText: plainText)
} }
} }