From e09b0ff4e3b4d7c4dd36fabef1889e67401a01a0 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Tue, 29 Mar 2022 12:34:54 -0400 Subject: [PATCH] Fix crash when AccountTableViewCell is cached by a SearchResultsTableViewController that has since decremented the reference count of the cell's account --- Tusker/Views/Account Cell/AccountTableViewCell.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tusker/Views/Account Cell/AccountTableViewCell.swift b/Tusker/Views/Account Cell/AccountTableViewCell.swift index 308693067f..03f1cbd067 100644 --- a/Tusker/Views/Account Cell/AccountTableViewCell.swift +++ b/Tusker/Views/Account Cell/AccountTableViewCell.swift @@ -36,7 +36,8 @@ class AccountTableViewCell: UITableViewCell { avatarImageView.layer.cornerRadius = Preferences.shared.avatarStyle.cornerRadius(for: avatarImageView) guard let account = mastodonController.persistentContainer.account(for: accountID) else { - fatalError("Missing cached account \(accountID!)") + // this table view cell could be cached in a table view (e.g., SearchResultsViewController) for an account that's since been purged + return } displayNameLabel.updateForAccountDisplayName(account: account)