Fix a bug found in internal test caused by casting

This commit is contained in:
Bob Sun 2017-04-01 09:48:41 -07:00
parent bab8edaeba
commit 894a6cc54c
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4

View file

@ -22,7 +22,7 @@ class EditPasswordTableViewController: PasswordEditorTableViewController {
override func shouldPerformSegue(withIdentifier identifier: String, sender: Any?) -> Bool {
if identifier == "saveEditPasswordSegue" {
let nameCell = tableView.cellForRow(at: IndexPath(row: 0, section: 0)) as! ContentTableViewCell
if let nameCell = tableView.cellForRow(at: IndexPath(row: 0, section: 0)) as? ContentTableViewCell {
if nameCell.getContent() != password?.name {
let alertTitle = "Cannot Save Edit"
let alertMessage = "Editing name is not supported."
@ -32,6 +32,7 @@ class EditPasswordTableViewController: PasswordEditorTableViewController {
return false
}
}
}
return true
}