From ac3dbad4dd8e40b858d9f5f0555c66696c36462d Mon Sep 17 00:00:00 2001 From: Bob Sun Date: Wed, 22 Mar 2017 19:06:53 -0700 Subject: [PATCH] Fix a bug caused by newly added delete password button --- pass/Controllers/EditPasswordTableViewController.swift | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pass/Controllers/EditPasswordTableViewController.swift b/pass/Controllers/EditPasswordTableViewController.swift index a1c2fdd..35e4219 100644 --- a/pass/Controllers/EditPasswordTableViewController.swift +++ b/pass/Controllers/EditPasswordTableViewController.swift @@ -40,10 +40,11 @@ class EditPasswordTableViewController: PasswordEditorTableViewController { var cellContents = [String: String]() for cell in cells { let indexPath = tableView.indexPath(for: cell)! - let contentCell = cell as! ContentTableViewCell - let cellTitle = tableData[indexPath.section][indexPath.row][.title] as! String - if let cellContent = contentCell.getContent() { - cellContents[cellTitle] = cellContent + if let contentCell = cell as? ContentTableViewCell { + let cellTitle = tableData[indexPath.section][indexPath.row][.title] as! String + if let cellContent = contentCell.getContent() { + cellContents[cellTitle] = cellContent + } } } var plainText = ""