From fadddeda7f9bd061a065903b4af3c600a93f8c12 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Wed, 11 Mar 2020 22:18:31 -0400 Subject: [PATCH] Fix crash when deleting draft Closes #94 --- Tusker/Screens/Compose/Drafts/DraftsTableViewController.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Tusker/Screens/Compose/Drafts/DraftsTableViewController.swift b/Tusker/Screens/Compose/Drafts/DraftsTableViewController.swift index 6273d584..41af1601 100644 --- a/Tusker/Screens/Compose/Drafts/DraftsTableViewController.swift +++ b/Tusker/Screens/Compose/Drafts/DraftsTableViewController.swift @@ -102,6 +102,7 @@ class DraftsTableViewController: UITableViewController { override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) { guard editingStyle == .delete else { return } DraftsManager.shared.remove(draft(for: indexPath)) + drafts.remove(at: indexPath.row) tableView.deleteRows(at: [indexPath], with: .automatic) }